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

Uncaught error from WebAssembly #21

Open
friskgit opened this issue Jan 14, 2025 · 6 comments
Open

Uncaught error from WebAssembly #21

friskgit opened this issue Jan 14, 2025 · 6 comments

Comments

@friskgit
Copy link

friskgit commented Jan 14, 2025

Hi,

Just for infformation: After compiling a simple Faust patch with faustwasm -wpa I received the following error message from WebAssembly:

Response has unsupported MIME type 'application/octet-stream' expected 'application/wasm'

In my interpretation this would be an error on the part of the server? The same page loads fine on a local server (python3 -m http.server). Changing the following line in create-node.js:

const dspModule = await WebAssembly.compileStreaming(await fetch("./dsp-module.wasm"));

to:

const dspModule = await WebAssembly.compile(await fetch("./dsp-module.wasm").then(res => res.arrayBuffer()));

got rid of the problem and is fine in this particular context. Again, this likely has to do with the servers erroneous response, right?

Best,
/Henrik

@sletz
Copy link
Member

sletz commented Jan 14, 2025

Hoping @Fr0stbyteR has an idea here.

@sletz
Copy link
Member

sletz commented Jan 14, 2025

@friskgit how is you code deployed ? Which kind of server ?

@Fr0stbyteR
Copy link
Collaborator

Yes the server need to be configured for *.wasm files to be sent as application/wasm MIME type, so the simple python command is not enough in this case.

@friskgit
Copy link
Author

Yes the server need to be configured for *.wasm files to be sent as application/wasm MIME type, so the simple python command is not enough in this case.

Great, that's what I thought. I will let my web host know that and in the mean time I'm using the hack that works for now.

@friskgit
Copy link
Author

Maybe try this https://github.com/cggallant/blog_post_code/blob/master/2020%20-%20July%20-%20Extending%20Python%E2%80%99s%20Simple%20HTTP%20Server/Python%203.x/wasm-server.py

Ah, I will check that out, but as i wrote, the simple python server actually does work. It was my web server that didn't work. Sorry for being unclear.

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

3 participants