Incorrect response MIME type. Expected 'application/wasm'.

The browser console reports an error: wasm streaming compile failed: TypeError: Failed to execute 'compile' on 'WebAssembly': Incorrect response MIME type. Expected 'application/wasm'. I am using SolidStart to set up a local-first project. I found electric-sql and am now using its wa-sqlite, which involves wasm. I might need to modify the MIME type, but I am not sure where to configure it.
4 Replies
TaQuanMinhLong
TaQuanMinhLong5mo ago
I guess it's about the vite configuration Or using import with URL then load
Madaxen86
Madaxen865mo ago
Maybe this Vite plugin will help: https://github.com/Menci/vite-plugin-wasm#readme
GitHub
GitHub - Menci/vite-plugin-wasm: Add WebAssembly ESM integration (a...
Add WebAssembly ESM integration (aka. Webpack's asyncWebAssembly) to Vite and support wasm-pack generated modules. - Menci/vite-plugin-wasm
TaQuanMinhLong
TaQuanMinhLong5mo ago
KiaClouth
KiaClouthOP5mo ago
Just tried adding it to app.config.ts, but it didn't work. I looked for methods like WebAssembly.instantiateStreaming in the code of wa-sqlite. I don’t know much about it. It may take more time. I plan to change the method for the time being. Thank you for your suggestion. I also want to change to import with URL, but this problem occurs inside wa-sqlite, and the compressed mjs is not easy to modify.😭
Want results from more Discord servers?
Add your server