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: AsyncCompile: Wasm decoding failed: expected magic word 00 61 73 6d, found 3c 21 44 4f @+0] #1031

Closed
Divy123 opened this issue Jun 3, 2019 · 8 comments

Comments

@Divy123
Copy link

Divy123 commented Jun 3, 2019

I am running my unit tests with tape in which the test is running after browserified. Now when I try running the tests which include my wasm code compiled with web assembly explorer, it shows me this error.

The file is a wasm file and not a wat file.

Please help me with this.

Also noting that the code works in chrome.

@rossberg
Copy link
Member

rossberg commented Jun 3, 2019

Those bytes are "<!DO" in ASCII, so probably you are trying to load an HTML document.

Anyway, this repo is for the Wasm spec and related issues. I suggest asking your question (with a bit more context) on StackOverflow.

@rossberg rossberg closed this as completed Jun 3, 2019
@Divy123
Copy link
Author

Divy123 commented Jun 3, 2019

@rossberg can you please elaborate upon this?

Those bytes are "<!DO" in ASCII, so probably you are trying to load an HTML document.

@rossberg
Copy link
Member

rossberg commented Jun 3, 2019

The bytes 3c 21 44 4f are the string "<!DO". The error message says that they occur in place of the Wasm "magic word", which should be the first 4 bytes of a valid Wasm module.

@Divy123
Copy link
Author

Divy123 commented Jun 3, 2019

Any possible solution to it?
What can be the cause? I would be really grateful if you can help me with this.

Thanks a ton!!

@Pauan
Copy link

Pauan commented Jun 3, 2019

What's most likely happening is that when you try to load the .wasm file (using fetch or whatever), the file path is wrong, or the .wasm file doesn't exist on the server, so the server returns a 404 page instead (which is an .html file).

So make sure that your server is configured correctly, that the .wasm file exists on the server, that the file path you are loading is correct, and that you have the right permissions and MIME type setup for the .wasm file (the .wasm file must be served with the MIME application/wasm).

If you're still running into problems, you should ask on StackOverflow, not here.

@Divy123
Copy link
Author

Divy123 commented Jun 3, 2019

Thanks @Pauan , this is something I can proceed with.

@benbatya
Copy link

Check your webserver's redirect filter... That worked for me

@nupur711
Copy link

nupur711 commented Jan 17, 2022

Uncaught (in promise) RuntimeError: Aborted(CompileError: WebAssembly.instantiate(): expected magic word 00 61 73 6d, found 3c 21 44 4f @+0) getting this error. It shows that .wasm file is loaded as a html file. If any can help me with the same to know ho to use wasm with nodejs project.

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

No branches or pull requests

5 participants