Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/Content type not return application/wasm #18

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions sandbox/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,13 @@ export default defineConfig(() => {
build: {
target: 'esnext',
},
optimizeDeps: {
// If you use Vite and install `fsrs-browser` from npm, you'll need the below `exclude` for reasons given here https://github.com/vitejs/vite/issues/8427
// since `fsrs-browser` uses wasm-pack. Without it, you'll run into the below error messages:
// `WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:
// TypeError: Failed to execute 'compile' on 'WebAssembly': Incorrect response MIME type. Expected 'application/wasm'.
// CompileError: WebAssembly.instantiate(): expected magic word 00 61 73 6d, found 3c 21 64 6f @+0
exclude: ['fsrs-browser'],
},
}
})
Loading