> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.weltpixel.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# MIME type error - Refused to apply style / Refused to execute script. Strict MIME checking is enabled

**Symptom:**  
**Refused to apply style / Refused to execute script** due to **Strict MIME checking**.

This usually occurs when Magento **hasn’t generated static content correctly**. It can also appear on a vanilla Magento install and isn’t necessarily related to a theme or extension.

In most cases, the error disappears after setting **correct permissions** and **regenerating static content**.

---

## Solution 1 — Fix permissions, switch modes, and deploy static content

1. **Set correct Magento permissions**  
   Follow the **Basic Permissions Setup** guide:  
   https://help.weltpixel.com/en/article/how-to-set-magento-2-permissions-and-avoid-installation-errors-ufa03p/?bust=1758010804465

2. **Switch to Developer mode, then to Production mode**  
   This cleans caches, compiles code, and generates static content:  
   https://help.weltpixel.com/en/article/how-to-set-magento-2-developer-and-production-mode-via-ssh-a2vjwi/?bust=1758010825880

3. **Deploy static content for each locale** (if you use locales other than `en_US`, e.g., `nl_NL`, `en_GB`)  
   Example command (run from Magento root):

       php bin/magento setup:static-content:deploy -f en_GB

> If the error persists, there may be an issue with missing `.htaccess` in `pub/static`.

---

## Solution 2 — Restore missing `.htaccess` in `pub/static`

1. Navigate to:

       pub/static/

2. **Check for `.htaccess`** (it’s a hidden file; press `Ctrl+H` in many file managers to reveal).

3. If missing, copy the **version-appropriate** `.htaccess` file into `pub/static/` from your Magento source for your exact Magento version.

4. **Clear caches** and retest:
   - Clear **browser cache**
   - Clear **Magento cache**

---

## Why this works

- **Permissions & ownership** ensure the web server can write static assets.  
- **Mode switch + static deploy** rebuilds static files with correct headers and paths.  
- **`.htaccess` in `pub/static`** sets proper MIME types and routing rules required by Magento’s static content server.