Open bobbobbio opened 1 year ago
For anyone trying to get around this you can try this in your Cargo.toml
wasm-bindgen = "=0.2.84"
Hello, downgrading wasm-bindgen
is a no-go for me since I need to use the latest version of the Cloudflare workers rust runtime, and they pin to wasm-bindgen=0.2.86
.
Is there another way of fixing this?
Jeez, I'm not pinned to a higher version, but why did I have to waste three hours debugging this?
The suggestion by @eduardvercaemer does fix the compile error, but pinning wasm-bindgen
has other undesired impacts for me and really should not be the solution to the problem.
I think I found the issue! It is within these lines (Exactly where the error points to):
I couldn't make sense of the error, but I looked at the docs of the Closure
struct. Interestingly, in the examples, it is always used with the dyn
keyword, which makes sense. The fix looks like this:
Closure<dyn Fn(...) -> ...>
On line 75 and 76 there is a warning: trait objects without an explicit 'dyn' are deprecated
. I guess historically, rust implicitly added the dyn
keyword, but at some point that feature got removed... Probably for the better. But since this package does not receive any updates (for 5 years, FIVE YEARS!!!), it is full of similar deprecation warnings that are never fixed. This is just the first instance where it broke. I am not sure why it works when pinning wasm_bindgen
though.
This crate really needs a general overhaul to fix all the warnings! It has thousands of dependents, it is crucial that this crate does not brake! @koute
So the project is abandoned then? I was hoping to use it as a way of integrating 3rd party libraries with no Rust bindings (Like Chart.js).
Any suggestion for automatic binding generation for such libraries?
Thank you @Dampfwalze for #429! Unfortunately this repo seems to be abandoned so this likely will never get merged.
For anyone that is encountering this issue you can patch the version of stdweb
your dependencies are using by adding the following to your cargo.toml
[patch.crates-io]
stdweb = { git = "https://github.com/Dampfwalze/stdweb/", rev = "a0086b4bd9b3116edeb679fe0ca477d48e06bb32" }
The diff between this commit and the latest tagged release is minimal so I wouldn't anticipate anything breaking. If you do, however, encounter problems then you can cherry pick the commit in #429 and apply it to whatever version of stdweb
is needed. The long term solution is to get crates to start using the patched version.
After updating wasm-bindgen to 0.2.86 (I think) I get a compilation error when trying to compile with wasm This was with
rustc 1.71.0-nightly (5ea3f0ae0 2023-05-23)
but fails on stable also