after cargo update, I'm getting this error when trying to adapt my component, do I need to pin wit-bindgen or something?
[xtask/src/main.rs:23] &command = Command {
program: "wasm-tools",
args: [
"wasm-tools",
"component",
"new",
"--adapt",
"wasi_snapshot_preview1=/opt/wasi/wasi_snapshot_preview1.reactor.wasm",
"target/wasm32-wasi/release/guest_editor.wasm",
"-o",
"/tmp/.tmpGVR7D1/initialized.wasm",
],
create_pidfd: false,
}
error: failed to encode a component from module
Caused by:
0: module requires an import interface named `__wbindgen_placeholder__`
__wbindgen_placeholder__
is a symbol from wasm-bindgen, unrelated to anything in the wasmtime / component ecosystem
so basically I have some dependency that thinks it should compile for the web, that helps me pin down where this is coming from, thank you :)
(I'm pretty sure it's swc)
iirc getrandom
is a common source of these errors, via its js
feature
oh yeah swc would make sense too
When this came up with Leptos (https://github.com/leptos-rs/leptos/issues/295), I created https://github.com/dicej/stubber as a hacky workaround.
fun thing: this is exactly the problem I have, it is leptos-reactive (which I use for something other than html) that has a hard dependency on serde-wasm-bindgen
I'll ask Greg why the dependency that pulls in wasm-bindgen isn't optional and stubber is exactly what fixes my problem ;)
Ramon Klass has marked this topic as resolved.
Last updated: Nov 22 2024 at 16:03 UTC