You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A clear and concise description of what the bug is.
Steps to Reproduce
Using a particular WASM file (I've attached it, but I understand that that could be sketchy), wasm-bindgen panics when I run:
wasm-bindgen calm-clamming.wasm --out-dir server
Expected Behavior
I expected it to make the JS glue file.
Actual Behavior
Crashed with:
❯ wasm-bindgen target/wasm32-unknown-unknown/debug/calm-clamming.wasm --out-dir server
thread 'main' panicked at /Users/jjspira/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wasm-bindgen-cli-support-0.2.99/src/wit/mod.rs:481:52:
no entry found for key
stack backtrace:
0: _rust_begin_unwind
1: core::panicking::panic_fmt
2: core::option::expect_failed
3: wasm_bindgen_cli_support::wit::Context::program
4: wasm_bindgen_cli_support::wit::process
5: wasm_bindgen_cli_support::Bindgen::generate_output
6: wasm_bindgen_cli_support::Bindgen::generate
7: wasm_bindgen::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Interesting, its unable to find the main function even though you seem to have marked it with a descriptor. What attributes did you put on your main function and did you compile as a binary or cdylib?
@daxpedda appreciate your insight! I had forgotten to pass --lib when compiling it (which I do as a cdylib...I think? I just say --lib and I have ["rlib", "cdylib"] in my Cargo.toml, so I'm not sure what happens there).
Correctly passing lib and using the resulting (calm_clamming_lib.wasm) this error goes away.
Should I close the issue?
To answer your question about the main function, it is:
I was unable to reproduce this. Would you mind creating a minimal reproducable example in a repo? It would be good if we produce a good error message instead of "no entry found for key".
Describe the Bug
A clear and concise description of what the bug is.
Steps to Reproduce
Using a particular WASM file (I've attached it, but I understand that that could be sketchy), wasm-bindgen panics when I run:
wasm-bindgen calm-clamming.wasm --out-dir server
Expected Behavior
I expected it to make the JS glue file.
Actual Behavior
Crashed with:
calm-clamming.wasm.zip
The text was updated successfully, but these errors were encountered: