Rule handbook metadata
- Rule
DET.JS.NO_CONSOLE_ERROR· lanedeterministic- Page status
- current
- page_version
01cb5ec00334415a9f9108a46f624c90a59e31b6735c536e0871f57174fd74e7- generated_at
- 2026-05-25T20:15:00.000Z
- registry_fingerprint
2ce40848effce579d3e4879f6ca85535183a14db201870a6c007da424624550c
How this rule is fixed
Pilot deterministic fixer: handbook_after · harness mode standalone · verify expect_rule_clean.
- Harness:
apply-harness-fixture-remediation.pycopies the After example HTML from this handbook page onto the defect fixture, theninvoke-det-ruleset-remediation-verify.shre-audits and expects zero findings for this rule. - Production sites:
run-website-ux-remediation-loop.shrunshandbook_html_patch(HTML patches inlib/ux-deterministic-fixers/fixers/patches/) before invoking the Cursor agent when the quality gate still fails.
Detection module: docs/design/ux-audit/deterministic-design-rules.md#det-js-no_console_error. Scroll down for Before / After examples and Evidence and remediation steps.
Purpose
Kitchen Sink pages ship Bootstrap 5 toggles (data-bs-toggle="tab", collapse, pill), <details> summaries, theme controls (forge-theme-trigger, [data-theme-toggle]), and mobile nav (navbar-toggler). Companion scripts under js/ (forge-theme.js, portal-nav.js, ks-diagram-modal.js, and related Ksj family modules) attach to those hooks during load and on user interaction.
This deterministic rule proves that golden-path smoke—a bounded sequence of up to five clicks on the selectors the auditor probes—does not emit console type error messages or pageerror uncaught exceptions. Failures usually mean a missing DOM hook, a script loaded before its dependency, or inline page logic that throws when a tab or theme control is activated.
Plan: Treat showcase and handbook routes with scripted chrome as smoke targets. Do: Fix the underlying exception in js/ or page wiring, then re-run Playwright smoke. Check: metrics.jsConsoleErrorReport has errorCount: 0. Adjust: Pair with DET.JS.PROGRESSIVE when content also depends on script to render; this rule does not replace noscript baseline checks.
Passing signals
metrics.jsConsoleErrorReport:{ errorCount: 0, errors: [], smokeSteps: N }aftercollectJsConsoleErrorReport(or precomputed crawl metrics).- Golden-path clicks on
[data-bs-toggle="tab"],collapse,pill,<details> summary, theme toggles, and.navbar-toggler[data-bs-toggle="collapse"]complete without new console errors. fs-tab-paneltab buttons switch panes via Bootstrap only; no inline handler callsconsole.erroror references undefined globals (forgeAmbient, chart hosts, etc.).forge-theme-triggerdropdown opens and applies theme without throwing;forge-theme.jsfinds expecteddata-bs-theme-valuenodes when present.pageerrorchannel stays silent during load and smoke (noUncaught ReferenceError/TypeErrorfrom missing bundles).- Ignored noise only: favicon load failures,
ResizeObserver loop, extension URLs, devtools source-map chatter (shouldIgnoreConsoleMessagefilters these). - Showcase smoke and consumer handbook builds pass the same probe on audited URLs.
Failing signals
consoleerror during load or smoke—for exampleChart init failed: missing containerwithkind=consoleandlocation=…app.js:12.pageerror—for exampleUncaught ReferenceError: forgeAmbient is not defined(major severity).- Finding evidence includes
kind=consoleorkind=pageerror, quotedmessage="…", optionallocation=,smokeStep=N, andurl=. - Tab click on
fs-tab-panel__tabstriggers an intentionalconsole.errorfrom inline<script>(harness defect pattern). - Theme or mobile nav toggle runs before
forge-theme.js/portal-nav.jsis loaded, leaving handlers onundefined. - Errors appear only after the fifth smoke step—still a fail if any non-ignored error occurred earlier on that URL.
- Page may still expose readable HTML without script (
DET.JS.PROGRESSIVE) while failing here—console hygiene is independent of noscript baseline.
Before example
Before (failing example)
Interaction scripts
Tab panels and theme controls must survive golden-path smoke without console errors.
Bootstrap tab wiring only—broken follow-up script below.
Inline script omitted in showcase embed (see handbook source).
Failing KS markup: enterprise-style tab panel plus inline script that logs a console error when the auditor clicks the tab control (same pattern as the ruleset harness defect fixture).
After example
After (passing example)
Interaction scripts
Tab panels and theme controls complete golden-path smoke without console or page errors.
Scripts enhance navigation; core copy stays in the DOM.
Inline script omitted in showcase embed (see handbook source).
Passing KS markup: same tab and theme affordances with standard bundles and no throwing inline handlers.
Evidence and remediation
Evidence: Playwright listeners in beginJsConsoleErrorCapture record console error lines and pageerror events while runGoldenPathSmoke clicks up to five visible controls from SMOKE_SELECTORS (tabs, collapse, pills, details summary, theme toggle, navbar toggler). Findings cite kind=, message="…", optional location=, smokeStep=, and url=. Module: design-rules/deterministic/generated/det-js-no-console-error.check.js. Metric: metrics.jsConsoleErrorReport.
Remediate (in order):
- Reproduce locally: Open DevTools → Console, load the failing route, click the same tab/theme/nav controls the auditor uses; note the first non-ignored error line.
- Fix script defects: Guard optional modules (charts, ambient layers, diagram modals) until DOM hosts exist; load
js/bundles withdeferin dependency order; remove debugconsole.errorand inline throws from generators. - Align DOM hooks: Match
data-bs-target/aria-controlsids to pane markup (fs-tab-panel__panes); ensure theme dropdown items exposedata-bs-theme-valuewhenforge-theme.jsis included. - Verify ignores: Confirm failures are not favicon, ResizeObserver, or extension noise—those are filtered and should not mask real app errors.
- Re-verify: Run
python3 generator/build-showcase.py, thenanalyze-website-ux.mjson showcase or consumerwebsite/roots; confirmjsConsoleErrorReport.errorCount === 0. Harness:generator/build_rule_defect_fixtures.pyandauditor-tests/invoke-det-ruleset-harness.sh --only-rule DET.JS.NO_CONSOLE_ERROR.