[Convex + Clerk + Next.js] Cant make static routes

In order to make Convex + Clerk work I need to pass useAuth() to the ConvexProviderWithClerk. This only works if I make my ClerkProvider dynamic with passing the dynamic prop. This makes it impossible to render a page statically in my Next.js app.
No description
6 Replies
ballingt
ballingt•2mo ago
@FleetAdmiralJakob 🗕 🗗 🗙 could you post more details, e.g. what version of Next.js is this?
FleetAdmiralJakob 🗕 🗗 🗙
Next 15, @clerk/nextjs 6
ampp
ampp•2mo ago
I think this basically related to the conversation in #clerk . at least in nextjs 14 and clerk 6 the ClerkProvider doesn't seem to respect the dynamic anyway, but isn't the whole point to not need to set dynamic. I've been getting this error constantly even with dynamic set:
. dev:next: 75 | if (!resolvedData && process.env.NEXT_PHASE !== PHASE_PRODUCTION_BUILD) {
. dev:next: > 76 | throw new Error(
. dev:next: | ^
. dev:next: 77 | 'Clerk: useAuth() called in static mode, wrap this component in <ClerkProvider dynamic> to make auth data available during server-side rendering.',
. dev:next: 78 | );
. dev:next: 79 | }
. dev:next: 75 | if (!resolvedData && process.env.NEXT_PHASE !== PHASE_PRODUCTION_BUILD) {
. dev:next: > 76 | throw new Error(
. dev:next: | ^
. dev:next: 77 | 'Clerk: useAuth() called in static mode, wrap this component in <ClerkProvider dynamic> to make auth data available during server-side rendering.',
. dev:next: 78 | );
. dev:next: 79 | }
FleetAdmiralJakob 🗕 🗗 🗙
Hmm, yeah. Weird. I want all routes when possible statically rendered. Setting dynamic on the root doesn't help with that
citrus
citrus•2mo ago
I also recieve this error. Do you also see this in your console? It's functioning without any errors though, so far.
No description
FleetAdmiralJakob 🗕 🗗 🗙
If you are talking about the last error: sorry, no