Summary
Clicking the DecDN Labs wordmark or any in-nav section link, hard-reloading the page, and then clicking the same link again leaves the URL with a duplicated fragment — e.g. decdn.org/#method#method#method#method after a few cycles. Repeating the click → reload → click loop keeps appending. The fragment is invalid (browsers only recognise the first #), the page no longer scrolls to the intended section on subsequent loads, and the URL is unshareable.
Repro
- Open
https://decdn.org/.
- Click the DecDN Labs wordmark, or any section link in the nav (e.g. "method").
- URL becomes
decdn.org/#method. ✓
- Hard-reload (Cmd+R / Ctrl+R).
- Click the same link again.
- Observe: URL becomes
decdn.org/#method#method. Repeat to grow further (#method#method#method#method, …).
Expected
URL stays decdn.org/#method. Clicking a same-hash link should be a no-op for the URL (and at most re-trigger the scroll to the section).
Affected
Desktop Next.js <Link> path in components/site/Chrome.tsx:
- Wordmark —
Chrome.tsx:148-174 (<Link href=\"/#intro\">).
- Section list —
Chrome.tsx:176-192 (<Link href={\/#${item.id}`}>`).
These are plain next/link Links with no onClick interception. The mobile drawer goes through MobileMenu.handleClick + history.replaceState(null, \"\", \#${anchor}`) (MobileMenu.tsx:236, 269-276`) and appears unaffected — worth confirming during triage.
Environment
next@16.2.6, react@19.2.6.
next.config.ts: output: \"export\", trailingSlash: true.
- Reproduced on the deployed site (Cloudflare Pages serving
out/).
Hypothesis / open questions
Repeated <Link href=\"/#method\"> clicks while the URL already carries #method appear to append the hash rather than replace it — consistent with an App Router hash-navigation quirk under output: \"export\" + trailingSlash: true. Could be a Next.js 16 bug or a local interaction; needs a clean repro to determine which.
Suggested next steps
- Reduce to a minimal Next 16 repro outside this project to determine upstream vs. local.
- If local: intercept these Link clicks (or wrap them) to detect same-hash navigation and fall back to
history.replaceState + smooth scroll, similar to the helper in MobileMenu.tsx:55-91 — that scroll routine is already a good reuse target.
Summary
Clicking the DecDN Labs wordmark or any in-nav section link, hard-reloading the page, and then clicking the same link again leaves the URL with a duplicated fragment — e.g.
decdn.org/#method#method#method#methodafter a few cycles. Repeating the click → reload → click loop keeps appending. The fragment is invalid (browsers only recognise the first#), the page no longer scrolls to the intended section on subsequent loads, and the URL is unshareable.Repro
https://decdn.org/.decdn.org/#method. ✓decdn.org/#method#method. Repeat to grow further (#method#method#method#method, …).Expected
URL stays
decdn.org/#method. Clicking a same-hash link should be a no-op for the URL (and at most re-trigger the scroll to the section).Affected
Desktop Next.js
<Link>path incomponents/site/Chrome.tsx:Chrome.tsx:148-174(<Link href=\"/#intro\">).Chrome.tsx:176-192(<Link href={\/#${item.id}`}>`).These are plain
next/linkLinks with noonClickinterception. The mobile drawer goes throughMobileMenu.handleClick+history.replaceState(null, \"\", \#${anchor}`)(MobileMenu.tsx:236, 269-276`) and appears unaffected — worth confirming during triage.Environment
next@16.2.6,react@19.2.6.next.config.ts:output: \"export\",trailingSlash: true.out/).Hypothesis / open questions
Repeated
<Link href=\"/#method\">clicks while the URL already carries#methodappear to append the hash rather than replace it — consistent with an App Router hash-navigation quirk underoutput: \"export\"+trailingSlash: true. Could be a Next.js 16 bug or a local interaction; needs a clean repro to determine which.Suggested next steps
history.replaceState+ smooth scroll, similar to the helper inMobileMenu.tsx:55-91— that scroll routine is already a good reuse target.