Hi! I have a Rust canister that uses the alloy-rs crate to import Ethereum RPC types with the sol! macro.
On deploying the canister and generating the WASM for it using the cargo build --release --target wasm32-unknown-unknown --features export-api command, the following error is thrown:
Failed during wasm installation call: The replica returned a rejection error: reject code CanisterError, reject message Error from Canister CANISTER_PID: Canister's Wasm module is not valid: Wasm module has an invalid import section. Module imports function '__wbindgen_describe' from '__wbindgen_placeholder__' that is not exported by the runtime..
This is likely an error with the compiler/CDK toolchain being used to build the canister. Please report the error to IC devs on the forum: https://forum.dfinity.org and include which language/CDK was used to create the canister., error code None
I have reviewed the two other similar topics in the forum that have faced the same issue, however the solutions mentioned in those topics are related to individual crates and do not work in this case. What could potentially be the issue here? Thank you for your help
Module imports function '__wbindgen_describe' from '__wbindgen_placeholder__' that is not exported by the runtime.
This error implied that the wasm-bindgen crate was introduced into your project as an indirect dependency. wasm-bindgen is only for Wasm runtime in browsers (to interact with the JS engine). This is not the case for the ICP.