failed to load module script: expected a javascript module script but the server responded with a mime type of "text/html". strict mime type checking is enforced for module scripts per html spec.
I get this error after each npm run build and firebase deploy. But when i clear the browser chache, the page loads normally, until the app gets rebuild app again.
This is my firebase.json
{
"hosting": {
"public": "dist",
"ignore": [],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}
- I tried deleting dist directory and rebuilding
- I followed instructions in the vite documentation:
The fact that clearing the browser cache fixes the problem, at least temporarily, is a strong indicator that caching might be part of the issue, but vite should handle cashbusting itself right ?