CompileError: WebAssembly.instantiate(): expected magic word 00 61 73 6d
fea17e86 opened this issue · 6 comments
Hi!
Using argon2-browser
with webpack brings up the following error message.
Uncaught (in promise) RuntimeError: abort(CompileError: WebAssembly.instantiate(): expected magic word 00 61 73 6d, found 6d 6f 64 75 @+0). Build with -s ASSERTIONS=1 for more info.
at abort (http://localhost:3000/static/js/0.chunk.js:788:9)
at http://localhost:3000/static/js/0.chunk.js:870:7
I also get the following warning before:
failed to asynchronously prepare wasm: CompileError: WebAssembly.instantiate(): expected magic word 00 61 73 6d, found 6d 6f 64 75 @+0
I would appreciate any hints.
Looks like it's not packed properly, you can find an example in this repo
I actually used an example provided by this repo.
I tried the webpack configuration path first with a react-aap-rewired webpack config of
module.exports = function override(config, env) {
config.module.noParse = /\.wasm$/;
config.module.rules.unshift({
test: /\.wasm$/,
loaders: ["base64-loader"],
type: "javascript/auto",
});
return config;
};
I also copied the js code from argon2.online, which results in the same error.
I am actually using webpack together with TypeScript and Babel. Might this issue be related to that?
Indeed, because my config works. You should probably investigate what's going wrong. If you create a minimal example without dependencies, maybe I or someone else will help with that.
Okay...so in my minimal TypeScript Webpack example it works. It must be related to the whole react build setup than.
Btw, sorry for the confusion. I switched from my personal to my work account. ;)