Free auditStart free
GuideError · Browser errors

Refused to apply style ... because its MIME type

Chrome refuses a stylesheet whose Content-Type is not text/css. Check the response in DevTools or curl, then fix SPA fallbacks, nginx mime.types and AddType.

3 min
read
8
sources
Oct 31, 2026
updated
Scaplet Editorial Team
author
In one line

Chrome refuses to apply a stylesheet when the response's Content-Type is not text/css. The usual cause is that the CSS URL returned something else, most often your index.html or an error page from a catch-all rewrite, or a server that sends the wrong type for .css. Request the file with curl -I, check the type and status, then fix the server rule.

30-second check

Where does your site stand?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?
Summarize this page withChatGPTClaudePerplexityGoogleAI Mode
01Mechanisms that refuse a stylesheet

Two rules cause this, and both look at Content-Type

The browser decides from the response header, not from the file name. Two documented mechanisms can reject a stylesheet whose type is wrong. I could not verify Chrome's exact console wording against a vendor page, so match the message by its meaning: a stylesheet was not applied because of its MIME type.
Mechanism

X-Content-Type-Options: nosniff

What the source says
MDN: for requests with a destination of "style", the browser blocks the response if the MIME type is not text/css. The Fetch Standard step reads: if the destination is "style" and the MIME type's essence is not "text/css", return blocked
How to spot it
The response has X-Content-Type-Options: nosniff and a different Content-Type
Mechanism

Strict stylesheet MIME check in Chromium

What the source says
In Chromium's CSSStyleSheetResource::CanUseSheet, with strict checking the sheet is used only if the Content-Type is empty, text/css or application/x-unknown-content-type. The comment says this matches Firefox
How to spot it
No nosniff, but the CSS URL returns text/html or text/plain
02How it works

Reproduce and read the response

Check the type the server sends
curl -sSI https://example.com/assets/app.css | grep -i -E "^HTTP|content-type|x-content-type-options"

# Expected
# HTTP/2 200
# content-type: text/css
# Wrong
# HTTP/2 200
# content-type: text/html   <- catch-all rewrite served index.html
  1. 01

    Find the failing URL

    Open DevTools, go to the Console, and click the stylesheet URL in the message, or open the Network tab and filter by CSS.

  2. 02

    Read status and headers

    In the Network tab, select the request and check the Status, Content-Type and X-Content-Type-Options response headers.

  3. 03

    Repeat it with curl

    Run the command below. A 404 or text/html body means a wrong path or a catch-all rewrite; text/plain means the server does not map .css.

03Fix it on your stack

Fix it on your server

nginx: load the full MIME table, and do not rewrite real files
http {
    # Without this, nginx's built-in table has only html, gif and jpg,
    # and other extensions get default_type (text/plain by default)
    include       mime.types;
    default_type  application/octet-stream;

    server {
        location / {
            # Serves a real file if it exists; only unknown paths fall back
            try_files $uri /index.html;
        }
    }
}
Apache: map the extension, and use FallbackResource for SPAs
AddType text/css .css

# Existing files such as CSS and images are served normally;
# only requests that map to nothing go to index.html
FallbackResource /index.html
Express: serve assets from a static directory
const express = require('express');
const app = express();

// Files in ./public are served by their path, e.g. /assets/app.css
app.use(express.static('public'));

app.listen(3000);

nginx documents the types directive as mapping file name extensions to MIME types, distributing a full table in conf/mime.types. If a request for a CSS file returns text/html, look at your try_files or FallbackResource target and your build's public path, because a typo in the stylesheet URL lands on the fallback.

04Checklist

Check the result

First2
curl -sSI on the stylesheet returns 200 and content-type: text/css
Hard reload with DevTools open and Disable cache ticked, and the console message is gone
Next1
Test a deliberately wrong CSS path: it should return a 404, not your home page. See 404 not found with .htaccess for Apache rewrite causes
Then1
If a CDN sits in front, request through the CDN hostname too, since it can cache a wrong response
Sources · 8

Every fact, linked and dated.

Official docs first. The date is when we last opened each page.
  • mozilla.org
  • whatwg.org
  • googlesource.com
  • nginx.org
  • apache.org
  • expressjs.com
  1. 01MDN: X-Content-Type-Optionsdeveloper.mozilla.org · checked 2026-11-01
  2. 02Fetch Standard: Should response to request be blocked due to nosniff?fetch.spec.whatwg.org · checked 2026-11-01
  3. 03Chromium source: css_style_sheet_resource.ccchromium.googlesource.com · checked 2026-11-01
  4. 04MDN: MIME types (media types)developer.mozilla.org · checked 2026-11-01
  5. 05nginx: ngx_http_core_module (types, default_type, try_files)nginx.org · checked 2026-11-01
  6. 06Apache httpd 2.4: mod_mime (AddType)httpd.apache.org · checked 2026-11-01
  7. 07Apache httpd 2.4: mod_dir (FallbackResource)httpd.apache.org · checked 2026-11-01
  8. 08Express: Serving static filesexpressjs.com · checked 2026-11-01
Questions

Asked a lot.

4 questions people ask next, answered from the sources on this page.

01Why does my CSS come back as text/html?

Usually the URL does not match a file and a catch-all rule serves index.html or an error page instead. Check the stylesheet path and the rewrite or fallback rule.

02What does nosniff have to do with stylesheets?

With X-Content-Type-Options: nosniff, browsers block a response used as a stylesheet if its MIME type is not text/css, per MDN and the Fetch Standard.

03Why is my CSS served as text/plain on nginx?

If mime.types is not included, nginx uses its small built-in types table and falls back to default_type, which defaults to text/plain. Add include mime.types; in the http block.

04Does this hurt SEO?

I did not find Google documentation on this specific error, so I make no claim. Blocked CSS is a rendering problem for visitors, and you can check how Google renders the page with its URL inspection tools.

Free · 2 minutes

Tools point. Agencies advise. This one ships.

Run the free audit, then approve the fixes. Every change can be undone.

Free, no card60 secondsNobody will call you
  • 46 fixes shipped without a ticket Brightpipe
  • 0→7 ChatGPT citations in six weeks Paylane