MIME type not executable JavaScript Origin: On your device Last updated 9 Oct 2026

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.

Exact message you may see because its MIME type ('text/html') is not executableRefused to execute script
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

  1. Open the script URL directly to see what’s returned
  2. Fix asset paths/base URL
  3. Configure correct MIME types

Detailed fix by platform

Nginx

  1. Make sure include mime.types; is present in the http block

How to diagnose

  1. Response — What does the script URL return?
  2. Type — Content-Type header

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: On your device. Errors that are often confused with or caused by this one (click to open):

App Service Application Error — Azure App Service: ":( Application Error" / container didn’t respond to HTTP pings (Azure)App Service Applicati…ChunkLoadError — ChunkLoadError: Loading chunk 123 failed. (JavaScript)ChunkLoadErrorDevTools failed to load source map — DevTools: Failed to load source map — Could not load content for https://…/app.js.map: HTTP error: status code 404 (Browser)DevTools failed to lo…FileNotFoundException assembly — Could not load file or assembly 'X, Version=…' or one of its dependencies (.NET)FileNotFoundException…module MIME type — Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html" (JavaScript)module MIME typeOPcache stale code — PHP still runs old code after deploy (OPcache not reset) (PHP)OPcache stale codeRefused to apply style from — Console: Refused to apply style from 'https://…/style.css' because its MIME type ('text/html') is not a supported stylesheet MIME type (Browser)Refused to apply styl…Service worker registration failed — Console: Failed to register a ServiceWorker: A bad HTTP response code (404) was received when fetching the script (Browser)Service worker regist…MIME type…

Explore the map of this error Full error map →

🧠 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.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.