Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

MDN Error Code: What It Means and How to Look It Up

· 5 min read · Home Tech

In this article
  1. Look Up Any Error Code on MDN in Six Steps
  2. The Error Codes You Are Most Likely Seeing
  3. Quick Checks Before You Dig Deeper
  4. Stopping the Same Error From Coming Back

MDN (the Mozilla Developer Network, now called MDN Web Docs) does not generate error codes itself — it is the reference site that explains them. If a message like "HTTP 404" or "TypeError: undefined is not an object" appeared in your browser or console, MDN has a page that tells you exactly what it means and what usually causes it.

Time 5 min · Steps 6 · Level Easy

The first split is between three kinds of error, and each lives in a different part of MDN. An HTTP status code is a short number (404, 500, 403) shown when a page or request fails to load. A JavaScript error is a longer message with a name like TypeError or SyntaxError, shown in the browser console or a crash log. A CSS or HTML validation message appears in developer tools when markup or styles are wrong. Read the first word or number of your message and you know which family you are in.

Look Up Any Error Code on MDN in Six Steps

  1. Copy the exact message. Select the whole error text, including the number and any text after the colon, because the details after the colon usually name the file and line where the problem happened.
  2. Search MDN directly. Type the code plus "MDN" into a search engine (for example "403 MDN" or "MDN TypeError cannot read properties of undefined"), or use the search box on the MDN site itself. MDN pages usually rank at or near the top for standard codes.
  3. Read the opening paragraph first. Every MDN error page opens with a one-paragraph plain-English explanation of what the code means; that alone resolves most confusion about what went wrong.
  4. Check the "common causes" section. HTTP code pages list typical reasons a server returns that code; JavaScript error pages list the coding mistakes that trigger the message, often with short code examples.
  5. Match a cause to your situation. If you are a visitor, the fix is usually on your side (reload, clear cache, check the address). If you built the page, the fix is usually in your code or your server configuration, and MDN's examples show the corrected version.
  6. Follow the links at the bottom. MDN error pages link to related specifications and related errors, which matters when one message is hiding a second problem underneath it.

The Error Codes You Are Most Likely Seeing

HTTP status codes (page will not load)

A 404 means the server is running but the page address does not exist — check for typos in the URL, or the page may have been moved or deleted. A 403 means the server understood the request but refuses to show the page, usually because of permissions or an access rule, not a broken link. A 500 means the server hit an internal problem on its side; nothing you type in the address bar fixes it, so wait and retry, or contact the site if it persists. A 502 or 504 means a gateway or timeout between you and the server failed — often temporary, so a refresh after a minute or two is worth trying. To confirm which one you have, open the browser's developer tools (menu paths differ slightly by version, but it is usually under the browser menu's "More tools" or "Developer" section), switch to the Network tab, reload the page, and click the failed request to see its status number.

JavaScript errors (something on the page broke)

"TypeError: cannot read properties of undefined (reading 'x')" is the most common one: code tried to use a value that was never set, often because data finished loading after the code ran. "SyntaxError" means the code itself is malformed — a missing bracket, quote or comma — and the message usually points to the line. "ReferenceError: x is not defined" means a name was used before it was created or was misspelled. To confirm, open the Console tab in developer tools; the message appears with the file name and line number, and clicking it jumps to the offending code. If you are only a visitor, these errors belong to the site's developers — a hard refresh (which bypasses the cached, broken script) sometimes clears a stale copy.

CORS and mixed-content messages

If the console mentions CORS or a "blocked by CORS policy" message, a page is trying to load data from another domain that has not allowed it. This is a server-side configuration issue, not something wrong with your browser. A mixed content warning means a secure (https) page is loading an insecure (http) resource, which browsers block; the fix is on the site side, switching that resource to https.

Quick Checks Before You Dig Deeper

Run through these in order, because they catch the majority of everyday errors in under two minutes:

  • Reload the page normally, then with a hard refresh to skip the cache.
  • Check the URL for typos, especially after an extra slash or a misspelled word.
  • Open the site in a private or incognito window — if it works there, an extension or cached file is the culprit.
  • Clear the site's cookies and cache for that one site rather than everything.
  • Try another browser or another network (mobile data instead of Wi-Fi) to rule out your connection.
  • If the error persists across all of these, it is on the server side, and waiting or contacting the site is the only option.

Stopping the Same Error From Coming Back

If you write code, the habit that prevents most of these lookups is reading the full console output, not just the first line — the line number and the text after the colon are the actual diagnosis. Keep the developer console open while testing pages so errors surface the moment they happen instead of pages later. For HTTP errors on sites you run, fix broken links when pages move and set up a redirect so old addresses land somewhere useful instead of a 404. And when you do land on an MDN error page, bookmark it: the codes repeat, and the second lookup is always faster than the first.

Official source: MDN Web Docs (Mozilla)