nextjs - 💡(How to fix) Fix Turbopack dev mode: pages fail to hydrate in 16.2.4 (works in 16.1.3 and production build) [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#93449Fetched 2026-05-04 04:57:43
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Author
Timeline (top)
closed ×1commented ×1labeled ×1locked ×1

Code Example

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin 25.3.0

Binaries:
  Node: 22.x
  pnpm: 10.x

Relevant Packages:
  next: 16.2.4 (broken) / 16.1.3 (works)
  react: 19.2.5
  react-dom: 19.2.5

Next.js Config:
  output: standalone
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

Private repo — details below reproduce the issue on any App Router project with middleware rewrites.

To Reproduce

  1. Upgrade from [email protected] to [email protected]
  2. Run next dev (Turbopack)
  3. Navigate to a page that goes through middleware rewrite (e.g. subdomain → /t/[tenant]/...)

Current vs. Expected behavior

Expected: Page renders and hydrates normally (as it does in 16.1.3 and in next build && next start with 16.2.4).

Current (16.2.4 dev only):

  • Initial load: TypeError: Cannot read properties of undefined (reading 'payload') in core.js:297
  • After clearing .next cache: page server-renders correctly but React never hydrates — buttons are not clickable, client components stay in loading state, no interactivity
  • HMR connects fine, no errors in console after cache clear

Key observations

  • next build && next start with 16.2.4 works perfectly — regression is Turbopack dev mode only
  • Rolling back to [email protected] with pnpm install --frozen-lockfile immediately fixes it
  • The corrupted .next Turbopack cache grew to 3.8 GB before we cleared it
  • React also upgraded from 19.2.3 → 19.2.5 in the same lockfile resolution, but production mode works fine with both

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin 25.3.0

Binaries:
  Node: 22.x
  pnpm: 10.x

Relevant Packages:
  next: 16.2.4 (broken) / 16.1.3 (works)
  react: 19.2.5
  react-dom: 19.2.5

Next.js Config:
  output: standalone

Which area(s) are affected?

Turbopack, App Router, Middleware/Proxy

Which stage(s) are affected?

next dev (Turbopack)

Additional context

We use a proxy.ts (Next.js 16 proxy, replaces middleware.ts) that rewrites subdomain requests to tenant-prefixed paths (e.g. shop-xinfer.example.com/chat/t/570666/chat). This rewrite flow works correctly in 16.1.3 dev and in 16.2.4 production — only 16.2.4 Turbopack dev mode fails to hydrate.

extent analysis

TL;DR

Downgrade to [email protected] to fix the hydration issue in Turbopack dev mode.

Guidance

  • Verify that the issue is specific to Turbopack dev mode by checking that next build && next start works correctly with [email protected].
  • Try clearing the .next cache to see if it temporarily resolves the issue, as it did in the reported case.
  • Check the proxy.ts configuration to ensure it is correctly handling subdomain rewrites, as this is a key part of the affected functionality.
  • Consider testing with a smaller .next cache to prevent it from growing to an excessive size, like the reported 3.8 GB.

Notes

The issue seems to be specific to the combination of [email protected] and Turbopack dev mode, and rolling back to [email protected] is a reliable workaround.

Recommendation

Apply workaround: Downgrade to [email protected] because it is a known working version that resolves the hydration issue in Turbopack dev mode.

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

nextjs - 💡(How to fix) Fix Turbopack dev mode: pages fail to hydrate in 16.2.4 (works in 16.1.3 and production build) [1 comments, 2 participants]