Skip to content

fix: move ClerkProvider inside html/body tags in Next.js examples#2963

Merged
jacekradko merged 2 commits intocore-3from
fix/clerk-provider-inside-html
Jan 13, 2026
Merged

fix: move ClerkProvider inside html/body tags in Next.js examples#2963
jacekradko merged 2 commits intocore-3from
fix/clerk-provider-inside-html

Conversation

@jacekradko
Copy link
Member

Summary

  • Moves <ClerkProvider> to be inside <html> and <body> tags rather than wrapping them in all Next.js App Router code examples
  • This is the correct pattern for Next.js applications

Changes

Updated 10 files:

  • docs/getting-started/quickstart.mdx
  • docs/reference/components/clerk-provider.mdx
  • docs/guides/organizations/getting-started.mdx
  • docs/reference/nextjs/errors/auth-was-called.mdx
  • docs/guides/development/migrating/authjs.mdx
  • docs/guides/development/shadcn-cli.mdx
  • docs/guides/secure/waitlist.mdx
  • docs/guides/secure/best-practices/csp-headers.mdx
  • docs/guides/dashboard/dns-domains/proxy-fapi.mdx
  • docs/guides/development/upgrading/upgrade-guides/nextjs-v6.mdx

Before (incorrect)

export default function RootLayout({ children }) {
  return (
    <ClerkProvider>
      <html lang="en">
        <body>{children}</body>
      </html>
    </ClerkProvider>
  )
}

After (correct)

export default function RootLayout({ children }) {
  return (
    <html lang="en">
      <body>
        <ClerkProvider>{children}</ClerkProvider>
      </body>
    </html>
  )
}

Notes

  • TanStack React Start examples were intentionally left unchanged as they correctly wrap <html> per that framework's requirements

@jacekradko jacekradko requested a review from a team as a code owner January 13, 2026 19:50
@vercel
Copy link

vercel bot commented Jan 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
clerk-docs Ready Ready Preview Jan 13, 2026 8:40pm

Move ClerkProvider to be inside the <html> and <body> tags rather than
wrapping them in all Next.js App Router code examples. This is the
correct pattern for Next.js applications.

Files updated:
- docs/getting-started/quickstart.mdx
- docs/reference/components/clerk-provider.mdx
- docs/guides/organizations/getting-started.mdx
- docs/reference/nextjs/errors/auth-was-called.mdx
- docs/guides/development/migrating/authjs.mdx
- docs/guides/development/shadcn-cli.mdx
- docs/guides/secure/waitlist.mdx
- docs/guides/secure/best-practices/csp-headers.mdx
- docs/guides/dashboard/dns-domains/proxy-fapi.mdx
- docs/guides/development/upgrading/upgrade-guides/nextjs-v6.mdx

Note: TanStack React Start examples were left unchanged as they
correctly wrap <html> per that framework's requirements.
Copy link
Member

@alexisintech alexisintech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

caught one! other than that, lgtm 😸💖

@jacekradko jacekradko merged commit bb6a6d0 into core-3 Jan 13, 2026
2 checks passed
@jacekradko jacekradko deleted the fix/clerk-provider-inside-html branch January 13, 2026 21:44
alexcarpenter pushed a commit that referenced this pull request Jan 20, 2026
)

Co-authored-by: Alexis Aguilar <98043211+alexisintech@users.noreply.github.com>
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.

2 participants