nextjs - 💡(How to fix) Fix 13 KB gz workAsyncStorage/workUnitAsyncStorage shipped to client when root layout uses ConvexAuthNextjsServerProvider (Next 16.2 Turbopack)

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…

Code Example

Operating System:
  Platform: linux
  Arch: x64
  Version: 6.18.1-arch1-2
Binaries:
  Node: (project pinned via package.json engines)
  npm: latest
Relevant Packages:
  next: 16.2.6 (Turbopack)
  react: 19.2.4
  @convex-dev/auth: 0.0.92
  convex: 1.39.1
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://github.com/Mohamedattiadev/finential (branch: main)

To Reproduce

  1. App Router project on Next 16.2.6 with Turbopack, React 19.2.4.
  2. app/layout.tsx imports ConvexAuthNextjsServerProvider from @convex-dev/auth/nextjs/server (server entry, correct — root layout is RSC) and wraps children.
  3. npx next build then inspect the shared client chunks under .next/static/chunks/.

Current vs. Expected behavior

Current: every route's firstLoadChunkPaths includes a shared chunk (~13 KB gzipped, identifier resembles 0n4z.<hash>.js) whose exports include Next.js 16 internals: workStore, workAsyncStorage, workUnitAsyncStorage, cacheNode, prerender, ReflectAdapter. These are server-only symbols.

Expected: these next/server internals should not be emitted into the client graph. The client subpath of @convex-dev/auth/nextjs (the "use client" entry consumed by <ConvexClientProvider>) imports only convex/react and an internal useAuth hook — nothing from next/server. None of these symbols are present in node_modules/@convex-dev or node_modules/convex source.

What we checked

  • The client entry @convex-dev/auth/nextjs/index.js is "use client" and has no next/server imports.
  • Grepping node_modules confirms workAsyncStorage/workUnitAsyncStorage/cacheNode/prerender/ReflectAdapter are exclusively Next.js 16 internals, never authored by convex or @convex-dev.
  • Same project on a stripped client tree (no ConvexAuthNextjsServerProvider in the server layout) does not emit the chunk.

Hypothesis: when an RSC layout uses an auth server provider that wraps client children, the Next.js 16 Turbopack client codegen pulls server-runtime helpers into the shared client bundle. May be related to Cache Components / PPR work since the symbols are PPR-adjacent (prerender, cacheNode).

Repro context

Full investigation notes: https://github.com/Mohamedattiadev/finential/blob/main/PERF_REPORT.md#rsc-server-runtime-still-shipping-to-client-13-kb-gzip and the Phase 3 follow-up at https://github.com/Mohamedattiadev/finential/blob/main/PERF_REPORT.md#L108-L114.

Provide environment information

Operating System:
  Platform: linux
  Arch: x64
  Version: 6.18.1-arch1-2
Binaries:
  Node: (project pinned via package.json engines)
  npm: latest
Relevant Packages:
  next: 16.2.6 (Turbopack)
  react: 19.2.4
  @convex-dev/auth: 0.0.92
  convex: 1.39.1

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

App Router, Turbopack

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

next build (Local), Vercel (Deployed)

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