Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CompileError: WebAssembly.instantiate(): expected magic word 00 61 73 6d, found 3c 21 44 4f @+0 #40953

Closed
pravinparab opened this issue Aug 21, 2020 · 2 comments

Comments

@pravinparab
Copy link

Hi,

While running angular application with wasm file , I am getting below error

CompileError: WebAssembly.instantiate(): expected magic word 00 61 73 6d, found 3c 21 44 4f @+0

Please check below code

private instantiateWASM() {
fetch('hello-wasm2/hello_wasm2_bg.wasm', { method: 'GET', mode: 'no-cors'})
.then(response => response.arrayBuffer())
.then(bytes => WebAssembly.instantiate(bytes, this.importObject))
.then(mod => {
console.log("In WASM");
this.wasmModuleRef = mod.instance.exports;
})
.catch(err => console.log(err));
}

@randall77
Copy link
Contributor

I don't think this is a Go issue. You're trying to load a webassembly file, but it is a html file.

See WebAssembly/spec#1031

@benbatya
Copy link

benbatya commented Sep 18, 2020

make sure that your web server's redirect filter excludes .wasm files.
I finally discovered that was the reason why my wasm files were being delivered as html.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants