Refused to execute script from 'x' because its MIME type ('text/html') is not executable
The browser fetched a script but the server labelled it text/html (usually an error page), so it refused to run it.
Seen on:
JavaScript
Meaning
With X-Content-Type-Options: nosniff, browsers enforce MIME types. A 404 HTML page or SPA fallback served at a .js URL triggers this.
Common causes
- Script URL returns a 404/HTML page
- SPA fallback serving index.html for missing assets
- Server not mapping .js to application/javascript
⚡ Quick fix
- Open the script URL directly to see what’s returned
- Fix asset paths/base URL
- Configure correct MIME types
Detailed fix by platform
Nginx
- Make sure
include mime.types;is present in the http block
How to diagnose
- Response — What does the script URL return?
- Type — Content-Type header
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026