# Dev-dependencies make \[Wasm module has an invalid import section\] happen

**URL:** <https://forum.dfinity.org/t/dev-dependencies-make-wasm-module-has-an-invalid-import-section-happen/20103>\
**Category:** Language Support\
**Tags:** Wasm\
**Created:** [May 19, 2023, 4:17pm UTC](https://forum.dfinity.org/t/dev-dependencies-make-wasm-module-has-an-invalid-import-section-happen/20103 "2023-05-19T16:17:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![witter](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/witter/32/4571_2.png) [@witter](https://forum.dfinity.org/u/witter)\
**Post date:** [May 19, 2023, 4:17pm UTC](https://forum.dfinity.org/t/dev-dependencies-make-wasm-module-has-an-invalid-import-section-happen/20103/1 "2023-05-19T16:17:27Z")

</div>

**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

---

<div class="post-metadata">

**Author:** ![lastmjs](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/lastmjs/32/3406_2.png) [@lastmjs](https://forum.dfinity.org/u/lastmjs)\
**Post date:** [May 20, 2023, 6:38am UTC](https://forum.dfinity.org/t/dev-dependencies-make-wasm-module-has-an-invalid-import-section-happen/20103/2 "2023-05-20T06:38:30Z")

</div>

Which dependencies are they? Sometimes you can turn off the feature that includes wasm-bindgen

---

<div class="post-metadata">

**Author:** ![witter](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/witter/32/4571_2.png) [@witter](https://forum.dfinity.org/u/witter)\
**Post date:** [May 20, 2023, 7:42am UTC](https://forum.dfinity.org/t/dev-dependencies-make-wasm-module-has-an-invalid-import-section-happen/20103/3 "2023-05-20T07:42:04Z")

</div>

Here I think that dev-dependencies should not affect the final compiled wasm, rather than enabling or disabling the features of a lib of dev-dependencies.  
I understand what you want to express is that the problem can be solved by disabling the features that do not support wasm. Yes, I can do this, but I think maybe dfx can solve this problem and make the lib used by unit tests more free:)

Thank you very much for your kind reply @lastmjs . I have indeed solved the problem in this way. I initiated this topic because I expect dfx to do better.
