You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
js-sys brings in wasm-bindgen when targeting wasm32 architechture.
However, wasm32-wasi targets should not use js-sys not wasm-bindgen.
The cargo toml should be updated to be something like [target.'cfg(target_arch = "wasm32", target_os = "unknown")'.dependencies] for js-sys.
This causes issues when compiling to wasm components, as when trying to convert a crate which uses wasm-bindgen to a wasm component results in the following error:
error: failed to encode a component from module
Caused by:
0: module requires an import interface named `__wbindgen_placeholder__`
The text was updated successfully, but these errors were encountered:
I'm not very familiar with WASI - my understanding is that with your proposed change, when running under WASI the crate should be using the Rust stdlib which will itself do the work of using the WASI-exposed syscalls?
Yep exactly right! wasm-bindgen is for web browsers, so it gives some issues when compiling to wasm32-wasi which is meant to be used on the server side only with something like wasmtime.
Describe the bug
js-sys
brings inwasm-bindgen
when targetingwasm32
architechture.However,
wasm32-wasi
targets should not use js-sys not wasm-bindgen.The cargo toml should be updated to be something like
[target.'cfg(target_arch = "wasm32", target_os = "unknown")'.dependencies]
forjs-sys
.This causes issues when compiling to wasm components, as when trying to convert a crate which uses wasm-bindgen to a wasm component results in the following error:
The text was updated successfully, but these errors were encountered: