I'm running a WebAssembly application on the backend through [wasmtime
], but as soon as I include tungstenite
as a dependency the generated .wasm file becomes invalid (has 2 random_get
definitions):
Error: failed to parse WebAssembly module
Caused by:
Invalid input WebAssembly code at offset 682: duplicate import name `wasi_snapshot_preview1::random_get` already defined
Both definitions point to the same signature and I'm not sure why this doesn't get de-duplicated by the Rust compiler.
Does anyone have an idea why this may be happening?
It looks like it works fine with the nightly compiler.
@Bernard Kolobara do you have the module-linking proposal enabled? That should be a valid wasm file but it becomes invalid with module linking
Yes, I had module-linking enabled. I just assumed that duplicate imports were always invalid. Thanks for the clarification!
Bernard Kolobara has marked this topic as resolved.
Last updated: Nov 22 2024 at 16:03 UTC