Open darionco opened 5 years ago
I think people should use WebAssembly.instantiateStreaming(fetch(...))
, or use rollup-plugin-url
to inline then load it, and support for WebAssembly in Rollup core is greenlit (https://github.com/rollup/rollup/issues/2099), so that'll be the ideal solution. I think those are better ways, but I'm open to ideas for fixing this in the meantime.
Edit: I think this was fixed by #12 or #15, but its not published because of bug #21
@darionco we're moving this plugin to a new rollup monorepo and will move your issue there once the move is done. Please stand by.
Take the following program
compiled as follows:
results in the following WAT:
loaded with the plugin:
prints out:
when loaded using fetch:
correctly prints:
I tracked down the issue to the base64 encoding/decoding as loading the wasm file using
rollup-plugin-url
works just fine. I believe you are suffering from this bug