Refused to apply style from Browser Origin: On your device Last updated 15 Oct 2026

Console: Refused to apply style from 'https://…/style.css' because its MIME type ('text/html') is not a supported stylesheet MIME type

The stylesheet URL returned something that is not CSS — usually a 404/HTML error page — and X-Content-Type-Options: nosniff makes the browser refuse to treat it as CSS.

Exact message you may see Refused to apply style fromis not a supported stylesheet MIME typeMIME type ('text/html') is not a supported stylesheet MIME typeand strict MIME checking is enabled
Seen on: Chrome Nginx Apache JavaScript

Meaning

The request for the CSS file got an HTML document (an error page, a login page or your SPA's index.html fallback). Fix the URL or server route so the real CSS is served with Content-Type: text/css.

Common causes

  • Wrong path to the CSS file (404 turned into index.html by SPA rewrite)
  • Server returning an HTML error or login page for the file
  • Wrong Content-Type for .css files
  • CDN or build step not deployed
  • Rewrite rules catching static files

⚡ Quick fix

  1. Open the CSS URL in a new tab — is it CSS or HTML?
  2. Fix the href path or deploy the missing file
  3. Serve .css as text/css and exclude static paths from SPA rewrites

Detailed fix by platform

Nginx

  1. Ensure include mime.types; and try_files $uri =404; for static locations so missing files do not fall back to index.html

Apache

  1. AddType text/css .css and add a rewrite condition RewriteCond %{REQUEST_FILENAME} !-f before the SPA fallback

JavaScript

  1. In Vite/Webpack check base/publicPath so asset URLs match where files are served

How to diagnose

  1. Response — HTML or CSS at the URL?
  2. Path — Correct base path?
  3. Rewrite — SPA fallback swallowing 404s?

🔧 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):

404 — HTTP 404 Not Found (HTTP)404Aw, Snap! — Chrome: Aw, Snap! Something went wrong while displaying this webpage. Error code: STATUS_ACCESS_VIOLATION / SIGILL / Out of Memory (Browser)Aw, Snap!DevTools 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…Failed to find a valid digest in the 'integrity' attribute — Console: Failed to find a valid digest in the 'integrity' attribute for resource … with computed SHA-256 integrity (Browser)Failed to find a vali…MIME type not executable — Refused to execute script from 'x' because its MIME type ('text/html') is not executable (JavaScript)MIME type not executa…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 typeThe canvas has been tainted by cross-origin data — Console: SecurityError: Failed to execute 'toDataURL' / 'getImageData' on 'HTMLCanvasElement': Tainted canvases may not be exported (Browser)The canvas has been t…Refused t…

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.