wasm-server-runner
wasm-server-runner copied to clipboard
wasm-bindgen scheme version error
The following error shows up periodically when using this project. The solution is to uninstall and reinstall wasm-server-runner (and possibly to update the wasm-bindgen-cli as instructed by the error message).
Error:
it looks like the Rust project used to create this wasm file was linked against
version of wasm-bindgen that uses a different bindgen format than this binary:
rust wasm file schema version: 0.2.100
this binary schema version: 0.2.92
Currently the bindgen format is unstable enough that these two schema versions
must exactly match. You can accomplish this by either updating this binary or
the wasm-bindgen dependency in the Rust project.
You should be able to update the wasm-bindgen dependency with:
cargo update -p wasm-bindgen --precise 0.2.92
don't forget to recompile your wasm file! Alternatively, you can update the
binary with:
cargo install -f wasm-bindgen-cli --version 0.2.100
if this warning fails to go away though and you're not sure what to do feel free
to open an issue at https://github.com/rustwasm/wasm-bindgen/issues!
As far as I understand this is unavoidable, wasm-bindgen doesn't have a stable API so you need to ensure that the versions match.
So far I haven't had a problem with occasionally updating both when there was a mismatch, so that seems like an acceptable situation to me.
The only thing we could do if this message leads to confusion would be to display a custom error message, mentioning the suggested resolution of
cargo install wasm-server-runner
cargo update wasm-bindgen
Yep it just needs to be documented.
So far I haven't had a problem with occasionally updating both when there was a mismatch, so that seems like an acceptable situation to me.
It might be obvious to you, but the last 2 times it happened I wasted a ton of time trying to track down how to fix it.
Ideally you could publish a new version on crates.io, so that those who install using cargo install --locked wasm-server-runner could benefit from the updated Cargo.lock...
It might be obvious to you, but the last 2 times it happened I wasted a ton of time trying to track down how to fix it.
That's very fair. I've updated the message, it now looks like this:
Error: The rust project was linked against a different version of wasm-bindgen.
wasm-server-runner version: 0.2.92
wasm file schema version: 0.2.100
To resolve this, update the wasm-bindgen dependency and/or wasm-server-runner binary:
cargo update -p wasm-bindgen
cargo install -f wasm-server-runner
Ideally you could publish a new version on crates.io, so that those who install using cargo install --locked wasm-server-runner could benefit from the updated Cargo.lock...
I've published v1.0.0 now with the change above and updated crate dependencies.
Although of course, this is a use case where running without --locked is useful so that you don't have to republish on every wasm-bindgen release.