-
Notifications
You must be signed in to change notification settings - Fork 412
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
old wasm-bindgen being run instead of new #853
Comments
👟 Steps to reproduce
|
Here is what the error looks like when version 0.2.19 is selected and used.
Then if you run the command directly, you see the |
* working example in JavaScript * copy sample and add rust webpackage template manually mapped wasm-bindgen calls for monaco.editor * commit to reproduce rustwasm/wasm-pack#853 * rust example runs, js_namespace on function * renamed to monaco-editor-hello-world * configure Monaco environment in rust * move index.js * ignore pkg/ too * move bindings to module
old bindgen is crashing on me also |
This isn't a bug in Rust, wasm-bindgen, or wasm-pack, it is a mistake in your code. When you specify So you will have two different packages which are both called The reason why this happens is because Cargo treats crates.io packages and git packages as completely separate. This is similar to how Cargo treats version 1.0 as completely separate from version 2.0. The way to fix this is to use [patch.crates-io]
wasm-bindgen = { git = "https://github.com/rustwasm/wasm-bindgen" } What this does is it tells Cargo that whenever it imports the You will probably need to add some patches for other crates as well: [patch.crates-io]
wasm-bindgen = { git = "https://github.com/rustwasm/wasm-bindgen" }
wasm-bindgen-shared = { git = "https://github.com/rustwasm/wasm-bindgen" }
wasm-bindgen-backend = { git = "https://github.com/rustwasm/wasm-bindgen" }
wasm-bindgen-macro = { git = "https://github.com/rustwasm/wasm-bindgen" }
js-sys = { git = "https://github.com/rustwasm/wasm-bindgen" }
web-sys = { git = "https://github.com/rustwasm/wasm-bindgen" } |
Thank you @Pauan for the detailed explanation! ❤️ |
Confirming that it worked. In my case, I just had to override [patch.crates-io]
wasm-bindgen = { git = "https://github.com/rustwasm/wasm-bindgen" } |
🐛 Bug description
The
Cargo.lock
file has two wasm-bindgen entries and the wrong one is being picked and used.The old 0.2.19 is a dependency from
console_error_panic_hook
, coming fromwasm-bindgen-test
.🤔 Expected Behavior
It picks 0.2.63 instead of 0.2.19.
🌍 Your environment
The text was updated successfully, but these errors were encountered: