Editorial illustration; the messages are representative examples, not a screenshot of a particular site.
When a web page breaks, most people open Chrome DevTools, copy the biggest red error in the Console, and paste it straight into a search engine or a Slack channel. Sometimes that gets lucky. More often, it wastes twenty minutes chasing an unrelated ad-blocker warning while the actual bug happened three seconds earlier—or disappeared when the page redirected.
The browser Console is not a verdict. It is a chronological log of what the browser, the page’s JavaScript, and any installed extensions happened to complain about. Whether you are a developer, a QA tester, or a site owner trying to explain why a checkout button stopped working, the goal is simple: isolate the first relevant error, tie it to a specific user action, and gather enough context so someone else can reproduce it without guessing.
Start with the action, not the reddest line
Before looking at DevTools, write down the smallest possible description of what failed: “Clicking Save leaves the form spinning,” or “The postcode dropdown stays empty after selecting Selangor.”
Once you have that sentence, open DevTools (F12 or Cmd+Option+I on macOS, Ctrl+Shift+I on Windows/Linux), switch to the Console tab, and clear the existing messages (Cmd+K / Ctrl+L or the clear icon). Perform the failing action once.
Clearing first gives you a clean time boundary. Warnings emitted while the page loaded—like a third-party chat widget complaining about cookies—are often harmless background noise. An uncaught exception that fires the instant you click Submit is a much stronger lead.
One critical setting to know: if clicking the button triggers a full page reload or redirect, the Console wipes itself by default. Tick Preserve log in the Console settings gear before reproducing so you do not lose the exact error that fired right before navigation. Also, never paste unfamiliar JavaScript snippets into the Console just because a random forum post or scam prompt tells you to; DevTools runs code with full access to your active session and cookies.
Separate your site’s code from browser noise
A modern browser tab runs more than your application. Ad blockers, password managers, grammar checkers, and corporate proxy extensions all inject scripts into the DOM. An error from chrome-extension://... usually belongs to an extension, not your codebase—though extensions can still break legitimate rich-text editors or form scripts by mutating the DOM unexpectedly.
Check the source file and line number on the right side of each Console message:
- Paths under your own domain (for example,
/assets/js/checkout.min.js:42) are prime suspects. ERR_BLOCKED_BY_CLIENTon an analytics or pixel script usually means uBlock Origin or Brave Shields blocked tracking, which rarely breaks a save button unless your code foolishly awaits the analytics call before submitting the form.- Chrome’s log-level dropdown lets you hide Verbose or Info messages, and the filter box accepts negative filters like
-extension:to strip out extension noise. Just remember to clear the filter if the filtered view comes up empty—sometimes a Warning right before an Error explains why the error happened.
Read the error message like a sentence
Instead of panicking at the red text, break the message into four concrete questions:
- What operation failed? (Reading a property, parsing JSON, calling a function.)
- Which value was unexpected? (
undefined,null, a string instead of an object.) - Where did it happen? (File and line number.)
- Did it happen during your action or during unrelated background polling?
Take two classic JavaScript errors you will see constantly on WordPress, Drupal, and ASP.NET frontends:
Uncaught TypeError: Cannot read properties of undefined (reading 'id')
This does not mean “JavaScript is broken.” It means your code expected an object with an .id property, but got undefined instead—perhaps an API returned an empty array, a DOM selector missed an element after a template change, or a user clicked before async data finished loading. Avoid slapping ?.id optional chaining everywhere just to silence the red text; if id is supposed to be required, hiding undefined only pushes the bug further downstream into a broken POST request.
SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON
This almost never means your JSON parser is faulty. It means response.json() tried to parse an HTML page. Usually the server returned a 404, a 500 PHP/ASP.NET error page, a WordPress login redirect, or a Cloudflare challenge page instead of JSON.
Expand the stack trace and check the Network tab
Click the small arrow beside a Console error to expand its stack trace. The top frame is where JavaScript threw the exception, which is often inside a framework helper or minified bundle. Walk down the stack until you hit the first frame belonging to your own application code. If you have source maps enabled in staging, DevTools will map minified bundles back to readable source files and line numbers.
Whenever an error follows an API call or fetch(), switch straight to the Network tab (check Fetch/XHR). Find the request triggered by your click and inspect both the Headers and Response tabs:
- 401 / 403: Expired session, missing CSRF/nonce token, or a WAF rule (like Cloudflare) blocking the payload.
- 404: Wrong endpoint URL or missing route parameter.
- 500: Server-side exception—stop debugging the frontend and check the PHP, C#, or Nginx logs on the server.
For a deeper walkthrough on isolating slow or failing network calls, see How to Use Chrome DevTools to Find the One Request Making a Website Slow.
Run one controlled comparison
If the cause is still unclear, change one variable at a time so you know what actually matters:
- Normal window vs Incognito: If it works in Incognito, a browser extension or stale cookie/localStorage state is likely involved.
- Logged-in vs Logged-out: Points to role permissions, cached HTML served to guests, or personalised scripts.
- One specific record vs fresh data: Often exposes bad characters, null fields, or legacy data in that one database row.
- Desktop vs mobile viewport: Catches responsive scripts that only mount or hide elements at certain breakpoints.
Hand over a bug report a developer can actually use
When you pass the finding to a teammate or contractor, skip “the page is broken” and send a tight, reproducible note:
- URL and environment: Exact page URL, browser, and OS version.
- Steps to reproduce: Three to five numbered clicks from a clean state.
- Expected vs actual result: What should have happened versus what happened.
- First relevant Console error + Network status: Exact message, source file/line, and HTTP status code if an API call failed.
- What changed it: e.g., “Fails in normal Chrome, works in Incognito.”
Before pasting logs or screenshots into Jira, GitHub, or WhatsApp, scrub any Authorization headers, session cookies, API keys, or customer IC/phone numbers from the trace. For a complete template on structuring these handoffs, check Your Bug Report Is Not a Conversation: How to Give Developers a Repro They Can Use.