Problem:
I am using Rust for container development, and dev-dependencies in Cargo.toml are only used for unit testing, but when the package references in dev-dependencies come in, it will cause an error in dfx deploy: Failed to install wasm.
The Replica returned an error: code 5, message: “Wasm module of canister r7inp-6aaaa-aaaaa-aaabq-cai is not valid: Wasm module has an invalid import section. Module imports function ‘__wbindgen_describe’ from ‘wbindgen_p laceholder’ that is not exported by the runtime.”
If you remove the package reference in this dev-dependencies, you can execute dfx deploy normally
Expect:
dfx deploy can be executed normally
Environment:
macOS 13.3.1 (a)
dfx 0.13.1
rust 1.68.2
cdk 0.7.4
candid 0.8