# DevTools: Failed to load source map — Could not load content for https://…/app.js.map: HTTP error: status code 404

**Code:** `DevTools failed to load source map` · **Category:** Browser · **Seen on:** Chrome, Edge, JavaScript, Nginx

DevTools could not download the `.map` file that a script or stylesheet points to, so you see minified code instead of your sources. Visitors are not affected.

## Meaning

The last line of a bundle (`//# sourceMappingURL=app.js.map`) tells DevTools where the map is. The warning appears when the map was not deployed, is blocked or behind auth, or when a browser extension (`chrome-extension://…`) ships a bad reference. It is only a debugging warning; fix it by deploying the maps, or stop emitting the comment in production.

## Common causes

- Source maps not uploaded to the server (excluded from deploy or `.gitignore`d)
- Server or CDN blocks `.map` files or requires authentication
- Wrong `publicPath`/base so the map URL is wrong
- Third-party library or extension referencing a map it does not ship
- Maps served with the wrong path after a CDN rewrite

## Quick fix

1. Deploy the `.map` files next to the bundles, or turn maps off for production builds
2. Ignore warnings from `chrome-extension://` URLs — they are from extensions
3. In DevTools Settings turn off "Enable JavaScript source maps" if you do not need them

## Detailed fix by platform

### JavaScript

1. Vite: `build: { sourcemap: true }` (or `false`); webpack: `devtool: 'source-map'` or `false`; Next.js: `productionBrowserSourceMaps: true`

### Nginx

1. Make sure `.map` files are not denied: remove rules like `location ~ \.map$ { return 404; }` if you want maps available (or restrict them to your IP)

### Chrome

1. DevTools → Settings (F1) → Preferences → Sources → untick "Enable JavaScript source maps" to silence the warnings

## How to diagnose

1. **URL** — Does the .map URL open in a new tab?
2. **Origin** — Own bundle or an extension/library?
3. **Build** — Are maps generated and deployed?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/browser/devtools-failed-to-load-source-map)
