Skip to content

fix(nextjs): key App Router ClerkProvider children - #9615

Open
therealtunguyen wants to merge 1 commit into
clerk:mainfrom
therealtunguyen:fix/nextjs-clerk-provider-key-warning
Open

fix(nextjs): key App Router ClerkProvider children#9615
therealtunguyen wants to merge 1 commit into
clerk:mainfrom
therealtunguyen:fix/nextjs-clerk-provider-key-warning

Conversation

@therealtunguyen

Copy link
Copy Markdown

Description

Fixes #9415.

Adds stable keys to the static App Router ClerkProvider children so React does not emit a development-only unique-key warning when RSC streams them as lazy references. The issue's root-cause analysis describes the streaming behavior behind the warning.

No focused unit test is included because the warning requires React development-mode RSC payload chunking and lazy resolution; the existing App Router tests do not provide a streaming provider harness.

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Refactoring / dependency upgrade / documentation
  • other:

@vercel

vercel Bot commented Aug 29, 2026

Copy link
Copy Markdown

@therealtunguyen is attempting to deploy a commit to the Clerk Production Team on Vercel.

A member of the Team first needs to authorize it.

@changeset-bot

changeset-bot Bot commented Aug 29, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a2bd849

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@clerk/nextjs Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: a8c72144-e6cb-4d4d-8a9e-8ebd6445c8c2

📥 Commits

Reviewing files that changed from the base of the PR and between b42959a and a2bd849.

📒 Files selected for processing (3)
  • .changeset/calm-actors-wait.md
  • packages/nextjs/src/app-router/client/ClerkProvider.tsx
  • packages/nextjs/src/app-router/server/ClerkProvider.tsx
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • clerk/clerk_go (manual)
  • clerk/dashboard (manual)
  • clerk/accounts (manual)
  • clerk/backoffice (manual)
  • clerk/clerk (manual)
  • clerk/clerk-docs (manual)
  • clerk/cloudflare-workers (manual)

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

The App Router client ClerkProvider now assigns explicit keys to telemetry, scripts, and children elements. The children render through a keyed React.Fragment. The server ClerkProvider now assigns a key to the Suspense boundary for dynamic scripts. A changeset declares a patch release for @clerk/nextjs.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to a2bd8

This localized fix adds stable keys to App Router provider children to prevent a development warning, with no actionable merge-blocking risk remaining beyond normal checks and review.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. (1 skipped: 1 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the primary change: adding stable keys to App Router ClerkProvider children to fix React key warnings.
Description check ✅ Passed The description directly explains the React warning, root cause, fix, testing limitation, and issue reference.
Linked Issues check ✅ Passed The changes satisfy issue #9415 by keying the static client-provider children and the server Suspense boundary, which prevents the development-only React unique-key warning while preserving behavior.
Out of Scope Changes check ✅ Passed The code changes and changeset entry are directly related to fixing issue #9415. No unrelated changes are identified.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands.

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.

React "unique key prop" warning from ClerkProvider's own children (App Router)

1 participant