Skip to main content
GoodFirstPicks
DashboardIssuesReposLeaderboard

GoodFirstPicks by Leaveitblank © 2026

CreatorRequest a RepoPrivacy PolicyTerms of Service
[Turbopack] [Pages] Hydration error (or double render) when using dynamic imports in _app.tsx | GoodFirstPicks

[Turbopack] [Pages] Hydration error (or double render) when using dynamic imports in _app.tsx

vercel/next.js 6 comments 1mo ago
View on GitHub
mediumopenScope: somewhat clearSkill match: maybeNext.jsTypeScriptReact

Why this is a good first issue

Hydration issue with dynamic imports in _app.tsx that may require Turbopack-specific fixes.

AI Summary

The issue involves a hydration error when using dynamic imports in _app.tsx with Turbopack, with reports of double rendering. The problem appears related to specific Next.js versions and may require changes in how Turbopack handles dynamic imports during hydration. The scope is somewhat clear but involves complex interactions between Next.js, React hydration, and Turbopack.

Issue Description

Link to the code that reproduces this issue

https://github.com/rtrembecky/next-turbopack-hydration-repro

To Reproduce

  1. Install the deps - pnpm i
  2. Start the app - pnpm dev
  3. Navigate to http://localhost:3000

Current vs. Expected behavior

Current behavior:

Image

Expected: No errors.

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:29 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6000
  Available memory (MB): 32768
  Available CPU cores: 10
Binaries:
  Node: 24.2.0
  npm: 11.4.0
  Yarn: 1.22.19
  pnpm: 9.15.9
Relevant Packages:
  next: 16.0.1-canary.2 // Latest available version is detected (16.0.1-canary.2).
  eslint-config-next: N/A
  react: 19.2.0
  react-dom: 19.2.0
  typescript: 5.9.3
Next.js Config:
  output: N/A

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

Pages Router, Module Resolution, Turbopack

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

next dev (local), next build (local), Other (Deployed)

Additional context

Pinpointed broken versions:

  • canary: >= 15.1.1-canary.14, up to 16.0.1-canary.2 (latest at the time of writing)
  • stable: >= 15.2.0

Working versions:

  • 15.1.1-canary.13
  • 15.1.6

Background:

  • _app.tsx imports a component via next/dynamic - this causes a hydration issue
  • when the same component is imported from the page level as well, it works - http://localhost:3000/works page (in repro repo) works
  • when the <main> wrapper in _app.tsx is removed or replaced by a <> fragment, the dynamic element is rendered TWICE instead
    • so this issue looks related: https://github.com/vercel/next.js/issues/77712
    • and also this one where @gurkerl83 reported it's fixed in 15.1.1-canary.14, though it apparently broke something: https://github.c

GitHub Labels

TurbopackPages Routerlinear: turbopackModule Resolution

Want to work on this?

Claim this issue to let others know you're working on it. You'll earn 10 points when you complete it!

Risk Flags

  • requires Turbopack knowledge
  • potential deep React hydration issues
  • linked to multiple existing issues
Loading labels...

Details

Points10 pts
Difficultymedium
Scopesomewhat clear
Skill Matchmaybe
Test Focusedno