Open ACGNnsj opened 1 year ago
This sounds like it might have something to do with the internal implementation of WebAssembly streaming initialization.
I can't reproduce with wasm-pack 0.10.3 (with --target web
), it works with both await
and Promise.then
. But I can't seem to make wasm-pack 0.11.0 (which has deno as a target) work on my system without running into segfaults or into rust-wasm/wasm-pack#1245.
The build I did with wasm-pack 0.10.3 did use WebAssembly.instantiateStreaming
, so it's not a simple case of that method not working. Having the wasm-pack generated code in question, or some more detailed reproduction instructions (which version of wasm-pack? which target?) would be helpful.
Edit: Apparently it makes a difference whether you install wasm-pack with cargo install
or with the command at https://rustwasm.github.io/wasm-pack/installer/, at least on a linux system, because I'm not getting such errors for wasm-pack 0.11 when I use that command. I still can't reproduce though.
I was using wasm-pack 0.11.0 installed through cargo on Windows, and the target argument was web.
I can confirm that there are (extremely strange) issues with WASM streaming and the event loop where Deno behaves different than Firefox, Edge, Node and Bun (all tested with exactly/nearly the same code).
Minimal reproduction example: https://github.com/hansSchall/deno-wasm-streaming-mre
@hansSchall i'm unable to reproduce this.
I am using Deno 1.46.3 on Windows 11, maybe its a windows-only thing
I built a ESM module by wasm-pack and imported it into a js file. I can call the function from the module properly using 'await', while something went wrong when 'Promise.then' applied.
I found it stuck here.
Both methods work well in chrome.