WebAssembly / WebAssembly/WASI
unknown import: `__wbindgen_placeholder__::__wbindgen_cb_drop` has not been defined
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 5.8k
- Forks
- 333
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 3
Description
Hello,
I am trying to build a package halo2_backend I am working on and import it into javascript.
I can build the package with cargo build --lib --release --package noir_halo2_backend_pse --target wasm32-wasi. However, when I try to initialize using wasmer-js or wasi-js, or if I try to use wasmtime by the cli, it always produces the same error:
> wasmtime target/wasm32-wasi/release/noir_halo2_backend_pse.wasm
Error: failed to run main module `target/wasm32-wasi/release/noir_halo2_backend_pse.wasm`
Caused by:
0: failed to instantiate "target/wasm32-wasi/release/noir_halo2_backend_pse.wasm"
1: unknown import: `__wbindgen_placeholder__::__wbindgen_cb_drop` has not been defined
I've tried removing as many references to wasm-bindgen in a separate branch, including sub-dependencies, but have not progressed. Any suggestions on how I debug this issue would be greatly appreciated!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the failure with the wasmtime command against target/wasm32-wasi/release/noir_halo2_backend_pse.wasm and inspect its imports, focusing on the wasm-bindgen placeholder and the listed runtimes. Trace which dependency or build configuration introduces that import; done means the cause is identified and the WASI module instantiates without the unknown import.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, rust, wasm
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100