A section link whose id is not a valid CSS selector crashes the whole page #231
Labels
No Label
P0
P1
P2
P3
accessibility
backend
bug
content
data-integrity
enhancement
frontend
infra
integration
owner
owner-input
performance
phase-7
phase-8
release-blocker
security
seo
ui
ux
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: null/Queue-North-Website#231
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Seen at
a25077d(v0.9.5).What is true now.
src/components/ScrollToTop.jsx:9-10runsdocument.querySelector(hash).querySelectorthrows on an id that starts with a digit or is otherwise not a valid selector (/#1,#8x8-...), and the error, thrown in an effect in the root route, replaces the header, page and footer with the error screen.What it costs. Today a malformed link blanks a page. The long-form pages add section anchors precisely so search results and AI answers can link to them, and two of those sections are about 8x8.
What to do.
document.getElementById(decodeURIComponent(hash.slice(1)))inside try/catch; ignore a missing target. The content validator also requires ids that start with a letter.Verify: loading
/services#1and/#%E0in a browser leaves the page rendered with no console error, and/contact#contact-formstill scrolls to the form.Fixed in
b260bca. src/components/ScrollToTop.jsx now uses document.getElementById(decodeURIComponent(hash.slice(1))) inside try/catch instead of document.querySelector(hash). Proven in Chromium against the built site: querySelector('#1') raises a DOMException in that same browser, while /services#1, /#%E0 and /services#8x8-implementation each render with header, footer and h1 present and no page error, and /contact#contact-form still scrolls to the form (scrollY 518). Script: scratchpad/prove-hash.mjs.