-
Notifications
You must be signed in to change notification settings - Fork 255
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
TypeError: Incorrect response MIME type. Expected 'application/wasm' #5
Comments
Just wanted to make a note here for macOS users. For me, I was running into the same issue, and the suggestions online (of, say, adding a new MIME type to The following snippet does not work on macOS:
whereas the following does work:
Posting it here in case other frustrated people come across this looking for a solution on macOS. |
similar issue using 'web server for chrome' on linux. Adapted timmyjose solution while trying to follow along https://developer.mozilla.org/en-US/docs/WebAssembly/Text_format_to_wasm
|
I think Note that |
<script> fetch('my-file.wasm').then(response => response.arrayBuffer() ).then(bytes => WebAssembly.instantiate(bytes) ).then(obj => { console.log(obj.instance.exports.my_func()); }); </script> where do we have make these changes? |
That did not directly work for me, however this gist provides a python server that does work |
You need to install static-server rather than http-server. This is because the WebAssembly module needs to be served with a MIME type of application/wasm, and the MIME type is provided in the static-server package. |
Since
application/wasm
isn't an official MIME type yet, WebAssembly/spec#573, in case you got the type error of an incorrect response MIME type, you can add the following line in file/etc/mime.types
and then restart the server.FYI:
https://bugs.python.org/issue31670
python/cpython#3861
The text was updated successfully, but these errors were encountered: