Skip to content

Avoid Set in missing slots RSC payload#94216

Open
hukuda222 wants to merge 3 commits into
vercel:canaryfrom
hukuda222:fix/missing-slots-rsc-payload
Open

Avoid Set in missing slots RSC payload#94216
hukuda222 wants to merge 3 commits into
vercel:canaryfrom
hukuda222:fix/missing-slots-rsc-payload

Conversation

@hukuda222
Copy link
Copy Markdown

@hukuda222 hukuda222 commented May 29, 2026

What?

Avoid sending the dev-only missingSlots value as a Set in the initial RSC payload. The payload now carries missing slots as a string array only when there are actually missing slots, and the client reconstructs the Set before providing MissingSlotContext.

Why?

In development, pages without missing parallel route slots can still include an empty Set at initialRSCPayload.m, which triggers this warning:

Only plain objects can be passed to Client Components from Server Components. Set objects are not supported.

This warning points users at application Server/Client Component props even though the Set comes from Next.js internals.

How?

  • Serialize missingSlots as string[] | undefined in InitialRSCPayload.
  • Omit m when the set is empty.
  • Recreate Set<string> on the client only when missing slots are present.
  • Add a regression assertion to the existing app dir RSC basics test.

Fixes #73323

Testing

  • pnpm install
  • pnpm build-all
  • pnpm --filter=next types
  • pnpm exec prettier --check packages/next/src/client/app-index.tsx packages/next/src/server/app-render/app-render.tsx packages/next/src/shared/lib/app-router-types.ts test/e2e/app-dir/rsc-basic/rsc-basic.test.ts
  • pnpm lint-eslint packages/next/src/client/app-index.tsx packages/next/src/server/app-render/app-render.tsx packages/next/src/shared/lib/app-router-types.ts test/e2e/app-dir/rsc-basic/rsc-basic.test.ts
  • pnpm test-dev-turbo test/e2e/app-dir/rsc-basic/rsc-basic.test.ts

@hukuda222 hukuda222 force-pushed the fix/missing-slots-rsc-payload branch from 39618b2 to f62a09a Compare May 29, 2026 04:17
@hukuda222 hukuda222 marked this pull request as ready for review May 29, 2026 04:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Only plain objects can be passed from Client Components to Server Components on route handler

1 participant