TypeError: Failed to execute 'compile' on 'WebAssembly' [solved]

I currently get following Error in my build (using the regular publish -> download build as zip workflow)
the online preview works fine.

TypeError: Failed to execute 'compile' on 'WebAssembly': Incorrect response MIME type. Expected 'application/wasm'. playcanvas-stable.min.js:6![callstack-pc|407x500]

See the callstack below. As that seems to be something like a broken asset reference or else (not a script problem), any help on how to resolve that would be great.

Thanks in advance.

Hi @Rechi,

That seems like an issue serving the WASM files with the correct mimetype.

Are you getting the same error serving the build locally and on a regular web server? Also, older builds work?

1 Like

My guess is like Leonidas has mentioned, the MIME type hasn’t been set up on the webserver where the build is hosted.

Hi Leonidas, hi Yaustar
thanks for your response.
I get the error on my local development environment (xampp on windows).
I think the mimetype error is only a second step (the 404 error response of a missing asset returns a wrong mimetype for the wasm-handling). I tried a different pc-project within the environement and everything seems fine.
I will try it on my production environment, maybe I get a different error / response.

1 Like

Ok I think you guys where right. I assume I’ve added the basis compression in some of my recent builds (which adds the wasm) and results in the errors in my development environment as well as my production environment.

A build on playcanvas (I’ve should have tried that earlier, sorry) works fine:

an info on my production environment also points in that direction.

playcanvas-stable.min.js:6 compileStreaming() failed for files/assets/41165474/1/basis.wasm.wasm, falling back to arraybuffer download...

Thank you very much for your support.