Repository navigation
Closed
Copy link
Labels
Description
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 undefinedstops 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 failedafter 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.errormessages: 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:
- Error: uncaught exception thrown from a first-party script.
- Warn:
- hydration mismatches, recognised by message (React "Hydration failed" and minified errors build(deps): clear the 2026-09-29 advisory wave (undici, ip-address) #418, release: install tests never exercise the network #423, New rule: security/csp-violations - report what the browser actually blocked during rendered crawls #425; Vue "Hydration ... mismatch")
- first-party runtime requests answering 5xx or 404
console.errorfrom first-party code- any third-party exception or failure
- Grouping: findings are grouped across the site by normalised message and source file ("TypeError ... at /assets/app.js, 14 pages"), with sample pages.
- Not reported:
- 401/403 from first-party API calls (normal for a signed-out visitor; info at most)
- requests the renderer itself blocks or aborts
net::ERR_ABORTEDon beacons and navigationResizeObserver loopmessages- CSP violations (owned by New rule: security/csp-violations - report what the browser actually blocked during rendered crawls #425)
- pages detected as WAF or bot challenges
Notes
- Cost: render only, no extra page loads. Shares the listeners and post-load wait with New rule: security/csp-violations - report what the browser actually blocked during rendered crawls #425.
- Depends on: renderer support from New rule: security/csp-violations - report what the browser actually blocked during rendered crawls #425.
- Cloud only: it needs a rendered page, so it never runs in a local CLI audit. It must show up on the existing "cloud checks that didn't run" list there, which is how CLI users learn a cloud audit would catch these errors.
- Companion issue: New rule: broken scripts, stylesheets and fonts (no render needed) #703 (broken scripts, stylesheets and fonts, no render needed).
Acceptance Criteria
- Rendered fixture: an inline script that throws a
TypeErroron 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/mecall returning 401 is not reported as a warning or error - Rendered fixture: a script that throws 2s after
loadis still caught - Requests the renderer itself blocks or aborts,
ResizeObserver looperrors, and CSP violations produce noreliability/js-errorsfinding - The rule declares
meta.cloud, so a local CLI or--httpaudit 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
feat(rules): add reliability/js-errors for JavaScript errors and fail…
test(rules): update rule counts and pinned golden messages for reliab…
fix(rules): js-errors reads the cloud result before site data so a cu…
feat(rules): add reliability/js-errors for JavaScript errors and fail…
test(rules): update rule counts and pinned golden messages for reliab…
fix(rules): js-errors reads the cloud result before site data so a cu…
fix(rules): js-errors declares its checks and finding scope; docs say…
fix(rules): js-errors reports pages without runtime data as a coded g…
fix(rules): js-errors with every rendered page a WAF challenge is an …
feat(rules): add reliability/js-errors for JavaScript errors and fail…
test(rules): update rule counts and pinned golden messages for reliab…
fix(rules): js-errors reads the cloud result before site data so a cu…
fix(rules): js-errors declares its checks and finding scope; docs say…
fix(rules): js-errors reports pages without runtime data as a coded g…
fix(rules): js-errors with every rendered page a WAF challenge is an …