nextjs - 💡(How to fix) Fix App Router dev mode: browser Back after notFound() leaves previous page detached (silent break on stable, Connection closed + auto-reload on canary) [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vercel/next.js#93510Fetched 2026-05-06 06:11:46
View on GitHub
Comments
1
Participants
2
Timeline
2
Reactions
0
Timeline (top)
commented ×1issue_type_added ×1

Error Message

On [email protected]: The home page DOM restores from disk cache and looks correct, but the React tree is detached. Clicking the button does nothing, no event handlers fire, no console error. React DevTools shows components with mangled minified internal names (e.g. ew, c8, eS) that don't highlight any DOM element on hover. The page is silently broken until a hard reload. On [email protected]: Same flow throws Uncaught Error: Connection closed (twice — StrictMode pair) and Next then auto-reloads the document. Final state is interactive. Canary recovers gracefully where stable silently breaks. Underlying state mismatch appears identical. verified that the issue exists in the latest Next.js canary release as well as the stable version. However, the behavior is slightly different. In the current stable release silently detaches, canary throws an error and reloads the page.

Code Example

- next: 16.2.4 (also reproduces on 16.3.0-canary.10, different symptom)
- react / react-dom: 19.2.4
- Browser: Chrome (latest stable)
- OS: macOS
- Turbopack (default in Next 16)
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://github.com/chrisbrantley/next-back-bug-repro

To Reproduce

bash bun install bun dev

Open http://localhost:3000/.

Click the "Click me to test interactivity" button. It increments. Baseline confirmed. Click the link "Go to /trigger?fail=1". app/trigger/page.tsx calls notFound(), app/not-found.tsx renders with HTTP 404. Press the browser Back button. Click the interactivity button again. (nothing happens)

Current vs. Expected behavior

Expected behavior The home page restores cleanly. The button still increments.

Actual behavior On [email protected]: The home page DOM restores from disk cache and looks correct, but the React tree is detached. Clicking the button does nothing, no event handlers fire, no console error. React DevTools shows components with mangled minified internal names (e.g. ew, c8, eS) that don't highlight any DOM element on hover. The page is silently broken until a hard reload.

On [email protected]: Same flow throws Uncaught Error: Connection closed (twice — StrictMode pair) and Next then auto-reloads the document. Final state is interactive. Canary recovers gracefully where stable silently breaks. Underlying state mismatch appears identical.

Provide environment information

- next: 16.2.4 (also reproduces on 16.3.0-canary.10, different symptom)
- react / react-dom: 19.2.4
- Browser: Chrome (latest stable)
- OS: macOS
- Turbopack (default in Next 16)

Which area(s) are affected? (Select all that apply)

Not sure

Which stage(s) are affected? (Select all that apply)

next dev (local)

Additional context

verified that the issue exists in the latest Next.js canary release as well as the stable version. However, the behavior is slightly different. In the current stable release silently detaches, canary throws an error and reloads the page.

extent analysis

TL;DR

The issue can be potentially resolved by upgrading to a newer version of Next.js, such as the latest canary release, which recovers from the error and auto-reloads the document, or by investigating and addressing the underlying state mismatch causing the React tree to detach.

Guidance

  • Investigate the difference in behavior between Next.js 16.2.4 and 16.3.0-canary.10 to understand why the canary version recovers from the error while the stable version silently breaks.
  • Check the React DevTools to identify the components with mangled minified internal names and try to correlate them with the actual components in the code.
  • Verify if the issue persists when using a different browser or OS to rule out environment-specific problems.
  • Consider disabling StrictMode to see if it affects the behavior and error messages.

Example

No specific code snippet can be provided without further investigation, but checking the app/trigger/page.tsx and app/not-found.tsx files for any potential issues with the notFound() function and the rendering of the 404 page might be a good starting point.

Notes

The issue seems to be related to the interaction between Next.js, React, and the browser's cache, and the different behavior between the stable and canary releases suggests that there might be a fix or improvement in the newer version.

Recommendation

Apply workaround: Upgrade to the latest canary release of Next.js (e.g., 16.3.0-canary.10), as it recovers from the error and auto-reloads the document, providing a better user experience than the silent failure in the stable version.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING