Hi, I’m trying to use Havok in a StackBlitz Project but I’m having trouble initialising it.
The project is here:
I’m receiving the error shown below in the console and the code doesn’t progress past the await HavokPhysics() line.
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.