-
Notifications
You must be signed in to change notification settings - Fork 340
In nextjs/app-beta, the UserButton doesn't seem to work with Suspense? #1142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I am also seeing this behaviour, did you find a solution or does anyone else know if there is one? |
@lhennerley unfortunately not really, please let me know if you or anyone else have figured out the reason for this or a workaround? I am sure it's something to do with an imported client component not being able to be captured by the Suspense boundaries. Or the fetching of the client component is not registered as a |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
This issue was closed because it has been stalled for 10 days with no activity. |
I am seeing this issue of reloading/ flickering, during navigation also (NextJs 13 AppRouter) |
yeah no way to make it work with suspense, but I just stop the layout shift by putting it in a div and setting the width and height |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
Small update - we are working on a resolution for this one. So sorry for the delays! |
im having an issue with the userButton gives hydration error in next 13 and this userButton causing it |
@xNOVA2 The best way to get this addressed would be to open a new issue and provide a minimal reproduction π |
For me, it works well : import Loading from "@/app/loading";
import { ClerkLoading, SignedIn, SignedOut, UserButton } from "@clerk/nextjs";
export default async function User() {
return (
<>
<ClerkLoading>
<Loading />
</ClerkLoading>
<SignedOut>
<Link href="/education/sign-in" className={styles.linkSignin}>Entrar</Link>
</SignedOut>
<SignedIn>
<UserButton afterSignOutUrl="/education" />
</SignedIn>
</>
)
} use ClerkLoading |
Using |
We introduced a temporary solution with the |
Trying to use the UserButton component in a next 13 server component. I understand there's some time needed to fetch the data from the user via Clerk's api and retrieve the image.
I was wondering why this component/pattern doesn't adhere to the
<Suspense />
loading pattern. (Loading UI doesn't show before the component/image is ready)I've attached a gif of what it's kind of doing, and it does the same even when wrapped with:
Am I doing something wrong here or is the implementation of
UserButton
just doesn't really allow the effects of Suspense as it loads? Sorry if I'm missing something here. Still new to app-router and the clerk app-beta.Thanks!
The text was updated successfully, but these errors were encountered: