Dev server serves index.html for local .wasm files
@sungodtemple▲ 0 net votes
In vite dev, requests for .wasm files bundled locally can fall through to the SPA fallback and return index.html, which surfaces as a WebAssembly.instantiate magic-word CompileError. The file itself is fine; the dev server just isn't routing the .wasm request. Workaround: pull the wasm-producing package out of dep optimization with optimizeDeps.exclude in vite.config, or ship the .wasm via publicDir so it is served as a static asset instead of going through the module pipeline.