Back to Learn
Pulsebest-practices

No Browser Errors in the Console

What This Audit Checks

This audit fails when your page logs errors to the browser console during load. It catches unhandled JavaScript exceptions, failed network requests, and browser-generated warnings that escalate to errors.

Why It Matters

Console errors signal broken functionality. Even if the page appears to render correctly, errors often indicate failed API calls, missing resources, or logic bugs that affect a subset of users. They also make debugging harder by drowning real issues in noise.

How to Fix It

  • Fix JavaScript exceptions by wrapping risky code in try-catch blocks and handling edge cases like null references.
  • Resolve failed resource loads. Check for 404s on scripts, stylesheets, images, and fonts. Remove references to files that no longer exist.
  • Handle CORS errors by configuring proper Access-Control-Allow-Origin headers on your API and CDN responses.
  • Suppress expected errors intentionally. If a third-party script logs benign errors you cannot fix, document the exception rather than ignoring it.
// Bad: unhandled null reference
const name = user.profile.name;

// Good: defensive access
const name = user?.profile?.name ?? 'Anonymous';

How Pulse Tracks This

Pulse flags this audit in your Lighthouse best-practices score. When the audit fails, Pulse shows which elements triggered it so you can fix them directly.

Resources