-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
In order to deploy a SPA, usually you use
# netlify.toml
[[redirects]]
from = "/*"
to = "/index.html"
status = 200
While this works when deployed, it breaks local development. Loading the app over localhost returns a blank page and the console error:
Failed to load module script: Expected a JavaScript-or-Wasm module script but the server responded with a MIME type of "". Strict MIME type checking is enforced for module scripts per HTML spec.
Removing the redirects line from netlify.toml makes local development (vite
) work again, but then breaks in prod when you deploy.
What's the solution?
Metadata
Metadata
Assignees
Labels
No labels