Articles on: Magento 2 Pearl Theme User Guide

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


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


  1. 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/


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


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


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

Updated on: 16/09/2025

Was this article helpful?

Share your feedback

Cancel

Thank you!