[x] Provide the Frontend API key from your application dashboard.
Package + Version
[ ] @clerk/clerk-js
[ ] @clerk/clerk-react
[x] @clerk/nextjs
[ ] @clerk/remix
[ ] @clerk/types
[ ] @clerk/themes
[ ] @clerk/localizations
[ ] @clerk/clerk-expo
[ ] @clerk/backend
[ ] @clerk/clerk-sdk-node
[ ] @clerk/shared
[ ] @clerk/fastify
[ ] @clerk/chrome-extension
[ ] gatsby-plugin-clerk
[ ] build/tooling/chore
[ ] other:
Dependencies + versions
Provide a json with the dependencies used in your project (copy paste from yarn.lock / package-lock.json) or a github project / template that reproduces the issue.
*Include the @clerk/ packages and their versions!**
Arc Version 0.103.1 (38943) incognito window with no extensions
Description
Running a simple Next.js app and followed the quickstart. I wrap my layout in ClerkProvider imported from @clerk/nextjs/app-beta.
When I import the UserButton into an RSC, I get the following error:
1 of 3 unhandled errors
Next.js is up to date
Unhandled Runtime Error
Error: Hydration failed because the initial UI does not match what was rendered on the server.
Warning: Expected server HTML to contain a matching <div> in <div>.
See more info here: https://nextjs.org/docs/messages/react-hydration-error
Component Stack
div
Portal
../../node_modules/.pnpm/@clerk+clerk-react@4.16.1_react@18.2.0/node_modules/@clerk/clerk-react/dist/components/uiComponents.js (31:9)
eval
../../node_modules/.pnpm/@clerk+clerk-react@4.16.1_react@18.2.0/node_modules/@clerk/clerk-react/dist/components/uiComponents.js (66:11)
LoadedGuarantee
../../node_modules/.pnpm/@clerk+clerk-react@4.16.1_react@18.2.0/node_modules/@clerk/clerk-react/dist/contexts/StructureContext.js (22:28)
HOC
../../node_modules/.pnpm/@clerk+clerk-react@4.16.1_react@18.2.0/node_modules/@clerk/clerk-react/dist/components/withClerk.js (13:78)
div
body
ClerkContextProvider
../../node_modules/.pnpm/@clerk+clerk-react@4.16.1_react@18.2.0/node_modules/@clerk/clerk-react/dist/contexts/ClerkContextProvider.js (15:13)
ClerkProviderBase
../../node_modules/.pnpm/@clerk+clerk-react@4.16.1_react@18.2.0/node_modules/@clerk/clerk-react/dist/contexts/ClerkProvider.js (16:13)
Hoc
../../node_modules/.pnpm/@clerk+clerk-react@4.16.1_react@18.2.0/node_modules/@clerk/clerk-react/dist/utils/useMaxAllowedInstancesGuard.js (23:9)
ClerkProvider
../../node_modules/.pnpm/@clerk+nextjs@4.18.1_next@13.4.2_react-dom@18.2.0_react@18.2.0/node_modules/@clerk/nextjs/dist/app-beta/client/ClerkProvider.js (39:55)
html
Call Stack
throwOnHydrationMismatch
../../node_modules/.pnpm/next@13.4.2_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/react-dom-experimental/cjs/react-dom.development.js (6946:0)
tryToClaimNextHydratableInstance
../../node_modules/.pnpm/next@13.4.2_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/react-dom-experimental/cjs/react-dom.development.js (6985:0)
updateHostComponent$1
../../node_modules/.pnpm/next@13.4.2_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/react-dom-experimental/cjs/react-dom.development.js (16229:0)
beginWork$1
../../node_modules/.pnpm/next@13.4.2_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/react-dom-experimental/cjs/react-dom.development.js (18129:0)
HTMLUnknownElement.callCallback
../../node_modules/.pnpm/next@13.4.2_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/react-dom-experimental/cjs/react-dom.development.js (20199:0)
Object.invokeGuardedCallbackImpl
../../node_modules/.pnpm/next@13.4.2_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/react-dom-experimental/cjs/react-dom.development.js (20248:0)
invokeGuardedCallback
../../node_modules/.pnpm/next@13.4.2_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/react-dom-experimental/cjs/react-dom.development.js (20323:0)
beginWork
../../node_modules/.pnpm/next@13.4.2_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/react-dom-experimental/cjs/react-dom.development.js (26457:0)
performUnitOfWork
../../node_modules/.pnpm/next@13.4.2_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/react-dom-experimental/cjs/react-dom.development.js (25286:0)
workLoopConcurrent
../../node_modules/.pnpm/next@13.4.2_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/react-dom-experimental/cjs/react-dom.development.js (25272:0)
renderRootConcurrent
../../node_modules/.pnpm/next@13.4.2_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/react-dom-experimental/cjs/react-dom.development.js (25228:0)
performConcurrentWorkOnRoot
../../node_modules/.pnpm/next@13.4.2_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/react-dom-experimental/cjs/react-dom.development.js (24102:0)
workLoop
../../node_modules/.pnpm/next@13.4.2_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/scheduler-experimental/cjs/scheduler.development.js (261:0)
flushWork
../../node_modules/.pnpm/next@13.4.2_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/scheduler-experimental/cjs/scheduler.development.js (230:0)
MessagePort.performWorkUntilDeadline
../../node_modules/.pnpm/next@13.4.2_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/scheduler-experimental/cjs/scheduler.development.js (537:0)
Other things I've tried:
Removing pnpm-lock.yaml, removing .next, npx npkill, pnpm store prune etc.
Hmm it seems like the error occurs when both the UserButton and the rest of my page render. But goes away when one or the other is removed...strange. it might be an issue on my side. sorry for the false alarm!
Package + Version
@clerk/clerk-js
@clerk/clerk-react
@clerk/nextjs
@clerk/remix
@clerk/types
@clerk/themes
@clerk/localizations
@clerk/clerk-expo
@clerk/backend
@clerk/clerk-sdk-node
@clerk/shared
@clerk/fastify
@clerk/chrome-extension
gatsby-plugin-clerk
build/tooling/chore
Dependencies + versions
Provide a json with the dependencies used in your project (copy paste from yarn.lock / package-lock.json) or a github project / template that reproduces the issue.
*Include the @clerk/ packages and their versions!**
Example:
Lockfile
Browser/OS
Arc Version 0.103.1 (38943) incognito window with no extensions
Description
Running a simple Next.js app and followed the quickstart. I wrap my layout in
ClerkProvider
imported from@clerk/nextjs/app-beta
.When I import the
UserButton
into an RSC, I get the following error:Other things I've tried:
pnpm-lock.yaml
, removing.next
,npx npkill
,pnpm store prune
etc.Would appreciate any help or guidance, thank you!