wasm-tool / parcel-plugin-wasm.rs

wasm-bindgen support for Parcel bundler
MIT License
66 stars 16 forks source link

Broken with latest version of wasm-bindgen #30

Closed Pauan closed 4 years ago

Pauan commented 4 years ago

This was first reported here: https://github.com/rustwasm/wasm-bindgen/issues/2120

The problem is that wasm-bindgen changed its code generation, and since this plugin does custom parsing of the JS code, that is now broken.

In addition, wasm-bindgen now generates a foo_bg.js file (rather than foo.js), so the file path needs to be updated as well.

However, most of this complexity can be avoided by using --target web. Then it wouldn't need to do custom parsing, and it wouldn't need a custom init section either.

kaoet commented 4 years ago

Temporary workaround: in your Cargo.toml:

[dependencies]
wasm-bindgen = "0.2, <0.2.61"

That keeps you away from the broken 0.2.61+ version.