preview-48ed283b9d5ba.js:2 wasm streaming compile failed: TypeError: Failed to execute 'compile' on 'WebAssembly': Incorrect response MIME type. Expected 'application/wasm'.
preview-48ed283b9d5ba.js:2 falling back to ArrayBuffer instantiation
preview-48ed283b9d5ba.js:2 failed to asynchronously prepare wasm: CompileError: WebAssembly.instantiate(): expected magic word 00 61 73 6d, found 3c 21 44 4f @+0
preview-48ed283b9d5ba.js:2 Aborted(CompileError: WebAssembly.instantiate(): expected magic word 00 61 73 6d, found 3c 21 44 4f @+0)
HavokPhysics_umd.js:9 Uncaught (in promise) RuntimeError: Aborted(CompileError: WebAssembly.instantiate(): expected magic word 00 61 73 6d, found 3c 21 44 4f @+0). Build with -sASSERTIONS for more info.
at abort (HavokPhysics_umd.js:9:6495)
at eval (HavokPhysics_umd.js:9:8264)
Any idea what I’m doing wrong?
Sometimes I find the Stackblitz itself can cause issues, but I’m not sure if this is the cause here. CodePen, JS Fiddle, and StackBlitz all seem to have little gremlins that require imports to be done in a certain way I find - I’m not using the Babylon Playground because the final output needs to actually be CodePen and StackBlitz, and while I can get scenes to work in the playground, it’s the setup that’s giving me issues.
Thanks,
Dale.
I have not tried this with StackBlitz, but that error often means you are missing your web assembly file WASM. It needs to be in the root of your project to work.
It generates automatically the first time you pull the latest source if using ES6 / Node. If using the precompiled babylonJS, I think it downloads itself if not in root. Both methods can be prone to error and failure.
The file itself is annoyingly a bunch of random alphanumeric digits.wasm. I kept trying to delete it when first getting havok to work thinking my webserver was hacked before I realized that was part of HAVOK redownloading itself without permission, like a suborn weed.
Thankyou.
While I tried including the npm package, the code above is actually just pulling from the cdn.
Is that not expected to work?