Skip to content

New rule: JavaScript errors and failed runtime requests on rendered pages #704

Description

@nc9

Problem

JavaScript errors are among the most common bugs that reach production, and squirrel reports none of them. A page can return 200 with clean HTML while in the browser:

  • an uncaught TypeError: Cannot read properties of undefined stops the menu, the form or the checkout from working
  • a framework hydration mismatch makes React or Vue discard the server HTML and re-render, which is a real bug and a performance cost
  • ChunkLoadError: Loading chunk 123 failed after a deploy, when a code-split chunk loaded at runtime no longer exists
  • a first-party fetch('/api/...') called after load answers 500, so a section of the page stays empty

Rendered crawls see all of this, but the rendered page result carries HTML and headers only.

Proposal

#425 already proposes that the renderer record page errors and failed requests (alongside CSP violations) before page scripts run, keep listening a few seconds after load, and attach them to the page result. This issue is the rule that consumes the page errors and failed requests. #425 consumes the CSP violations.

Collected per rendered page:

  • uncaught exceptions (pageerror): message, source URL, line
  • console.error messages: text, source URL
  • failed requests: URL, resource type, status or network error, for requests made at runtime (fetch/XHR, injected scripts, lazy chunks)

New rule reliability/js-errors, in the new Reliability category added by #703:

Notes

Acceptance Criteria

  • Rendered fixture: an inline script that throws a TypeError on load produces an error finding with the message and source location
  • Rendered fixture: the same exception on 5 pages produces one grouped finding with a page count of 5
  • Rendered fixture: a React hydration mismatch produces a finding identified as a hydration error
  • Rendered fixture: a first-party fetch('/api/data') made after load that returns 500 is reported; a /api/me call returning 401 is not reported as a warning or error
  • Rendered fixture: a script that throws 2s after load is still caught
  • Requests the renderer itself blocks or aborts, ResizeObserver loop errors, and CSP violations produce no reliability/js-errors finding
  • The rule declares meta.cloud, so a local CLI or --http audit lists it among the cloud checks that didn't run (computeLockedRules: the report's locked-rules section and the CLI footer), with the audience-specific prompt to run a cloud audit; it is never a silent skip
  • The rule has a docs page under docs/rules/reliability/

Activity

  1. added
    enhancement
    P2
    size: L
    rules
    and removed
    P2
    on Oct 12, 2026
  2. added theissue type on Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementrulessize: L

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions