# Refused to execute script from 'x' because its MIME type ('text/html') is not executable

**Code:** `MIME type not executable` · **Category:** JavaScript · **Seen on:** JavaScript

The browser fetched a script but the server labelled it text/html (usually an error page), so it refused to run it.

## 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

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/javascript/refused-to-execute-script-mime-type)
