-
Notifications
You must be signed in to change notification settings - Fork 30.6k
Open
Labels
TurbopackRelated to Turbopack with Next.js.Related to Turbopack with Next.js.
Description
Link to the code that reproduces this issue
https://github.com/happyjosh/turbopack-pages-router-bug
To Reproduce
- Create minimal
_app.tsxwith timing logs - Use
yarn dev --turbopack - Middle-click a link to open page in background tab
- Switch to the new tab and check console logs
Current vs. Expected behavior
When opening a Pages Router page in a background tab (middle-click or right-click -> open in new tab), the hydration is significantly delayed until the tab becomes visible.
Observed behavior:
- Module loads at ~1200ms with
visibilityState: hidden - App render happens at ~9200ms with
visibilityState: visible - ~8 seconds delay between module load and React hydration
Expected behavior:
Hydration should complete regardless of tab visibility.
Provide environment information
- Next.js: 16.x
- React: 19.x
- Turbopack: enabledWhich area(s) are affected? (Select all that apply)
Turbopack
Which stage(s) are affected? (Select all that apply)
next build (local)
Additional context
Key Finding
- Pages Router + Turbopack: Has this delay
- App Router + Turbopack: Works correctly (no delay)
- Pages Router + Webpack: Works correctly (no delay)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
TurbopackRelated to Turbopack with Next.js.Related to Turbopack with Next.js.