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

**Code:** `Refused to apply style from` · **Category:** Browser · **Seen on:** Chrome, Nginx, Apache, JavaScript

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.

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

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/browser/refused-to-apply-style-mime-type)
