You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have not already reached out to Clerk support via email or Discord (if you have, no need to open an issue here)
This issue is not a question, general help request, or anything other than a bug report directly related to Clerk. Please ask questions in our Discord community: https://clerk.com/discord.
Just a simple next js app with a layout, page, and client component wrapped in a suspense boundary. A promise is thrown in the client component to trigger the suspense boundary.
The infinite suspense triggered during the server render part of SSR should cause the nearest suspense boundary to display client-side. The client component should not render at all on the client until the suspense is resolved, but it does when we add ClerkProvider to the layout.
Actual behavior:
We see the component being rendered on the client through the console.log statement. (Removing ClerkProvider gets rid of this statement)
This is a dealbreaker for anyone that has SSR + progressive hydration, since the client component starts rendering before the matching server component finishes.
Hi there! Could you share more details about what you're trying to accomplish with this pattern? In theory, anything that would cause this component to re-render on the client would trigger the promise again, your linked example exhibits the behavior with next-theme.
Any client-component that infinitely suspends on the server should not render on the client, but adding ClerkProvider breaks that functionality.
The reproduction for Clerk is on the clerk branch specifically. Sorry if that wasn't clear
(next-theme had a similar bug, so that's why it's on the main branch)
I'm using React Query with SSR, (specifically with the useSuspenseQuery hook,) so if the component renders on client before the same component finishes loading on the server, we get two network requests. (defeating the whole point of SSR'ed requests)
Preliminary Checks
Reproduction
https://github.com/cirex-web/next-theme-ignored-suspense/tree/clerk
Just a simple next js app with a layout, page, and client component wrapped in a suspense boundary. A promise is thrown in the client component to trigger the suspense boundary.
Publishable key
pk_test_YmVsb3ZlZC1jaGFtb2lzLTQzLmNsZXJrLmFjY291bnRzLmRldiQ
Description
Run
pnpm dev
Expected behavior:
The infinite suspense triggered during the server render part of SSR should cause the nearest suspense boundary to display client-side. The client component should not render at all on the client until the suspense is resolved, but it does when we add
ClerkProvider
to the layout.Actual behavior:
We see the component being rendered on the client through the console.log statement. (Removing ClerkProvider gets rid of this statement)
This is a dealbreaker for anyone that has SSR + progressive hydration, since the client component starts rendering before the matching server component finishes.
Environment
The text was updated successfully, but these errors were encountered: