Skip to content

[Turbopack] Pages Router hydration delayed when tab opened in background #90684

@happyjosh

Description

@happyjosh

Link to the code that reproduces this issue

https://github.com/happyjosh/turbopack-pages-router-bug

To Reproduce

  1. Create minimal _app.tsx with timing logs
  2. Use yarn dev --turbopack
  3. Middle-click a link to open page in background tab
  4. 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: enabled

Which 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    TurbopackRelated to Turbopack with Next.js.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions