Skip to content

fix: keep Turbopack HMR chunk lists stable across routes - #102216

Closed
zhengdaodeguL wants to merge 1 commit into
vercel:canaryfrom
zhengdaodeguL:fix/turbopack-chunk-list-effects-102210
Closed

zhengdaodeguL wants to merge 1 commit into
vercel:canaryfrom
zhengdaodeguL:fix/turbopack-chunk-list-effects-102210

Conversation

@zhengdaodeguL

Copy link
Copy Markdown
Contributor

What?

Keeps Turbopack Server HMR working when an App Router instrumentation client dynamically imports a module used by multiple routes.

Why?

The routes shared one evaluated client chunk group and therefore reused its HMR chunk-list path. Route-specific async loader names made that list's contents change with the last requested route, causing conflicting effects for the same key and forcing Server HMR to re-evaluate modules.

How?

Give the shared App Router client runtime an HMR list identifier derived from the page entry while retaining the shared evaluated chunk group. Add a development regression test for two routes, the dynamic instrumentation import, chunk-list stability, and lazy module loading.

Fixes #102210

Verification

  • pnpm test-dev-turbo test/development/app-dir/instrumentation-client-hmr/instrumentation-client-hmr.test.ts passed on the fixed build. The test also failed on the canary-source control, as expected.
  • Local reproducer requests to /, /other, / all returned 200. Cumulative Server HMR failures / effect conflicts were 0 / 0, 0 / 0, 0 / 0 on the fix. On base 57edfeac4440da9a9e78e3d05f7ba5ef53d6a105, the counts were 0 / 0, 1 / 1, 2 / 2; the shared chunk-list SHA-256 flipped from 00444309481660eead7d2a2b5567030de0f5379799bebff4f4a575d65f78595e to 3d8eab12e42462390a4d410c1219869a8a4b5462104731ecb8a566f7bbf8f0b1 and back. The base regression test failed its chunk-list stability assertion.
  • cargo fmt --all -- --check, Prettier, ESLint, and git diff --check passed.
  • Not run: the full development test suite; focused regression and local reproducer cover this change.

@vercel

vercel Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Vercel Agent couldn’t finish reviewing your changes.
a9022ad • Mon, 23 Nov 2026 01:22:04 GMT • 3m 15s • Details

The pull request was closed while this review was running.

Review steps

     Step Time
Preparing the workspace 15.4s
Analyzing the changes 3m 0s
Finalizing the review

@github-actions github-actions Bot added tests Turbopack Related to Turbopack with Next.js. labels Nov 23, 2026
@zhengdaodeguL

Copy link
Copy Markdown
Contributor Author

Closing this PR — it was submitted from a stale fork base (133 commits behind canary), so the diff picked up unrelated upstream changes and shows conflicts. I will re-submit the same fix on the current canary. Sorry for the noise.

@zhengdaodeguL
zhengdaodeguL deleted the fix/turbopack-chunk-list-effects-102210 branch November 23, 2026 01:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests Turbopack Related to Turbopack with Next.js.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Turbopack dev: Server HMR fails with "conflicting effects for the same key" when instrumentation-client.ts has a dynamic import

1 participant