Open cirex-web opened 1 week ago
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
.
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