Closed roddyaj closed 6 years ago
If you remove the wasm_custom_section, wasm_import_module
features, does it work?
Are you on the latest nightly rust? rustup update nightly
If you remove the wasm_custom_section, wasm_import_module features, does it work?
(Because these should not be necessary anymore.)
Additionally, you may want to make sure that wasm-bindgen --version
(the CLI tool version) matches the wasm-bindgen
crate version in Cargo.toml (if they're mismatched it can cause bugs)
I ran rustup update nightly
and I'm on 1.29.0-nightly. I've now removed wasm_custom_section, wasm_import_module features. I still see the error. I am, however, on wasm-bindgen 0.2.14 according to wasm-bindgen --version
(even after I run cargo update -p wasm-bindgen
). Is there a better way to update wasm-bindgen, and is updating wasm-bindgen by hand just part of the workflow?
@roddyaj can you try running cargo install -f wasm-bindgen-cli
to see if it fixes the error for you? Eventually all this version juggling will be handled by wasm-pack
so this sort of error should be a thing of the past!
OK thank you that fixed it!
wasm-bindgen 0.2.14 works fine, but switching to 0.2.15 produces no Javascript bindings. The following is a simplified example:
Cargo.toml:
src/lib.rs:
I'm building with:
cargo +nightly build --release --target wasm32-unknown-unknown && wasm-bindgen target/wasm32-unknown-unknown/release/rust_bucket.wasm --out-dir target
With wasm-bindgen = "=0.2.14" I get target/rust_bucket.js that contains the function as expected:
With wasm-bindgen = "=0.2.15" I get target/rust_bucket.js:
That's the whole file. Note there is no binding function.