App Remounts on Navigation with Tanstack Router + Convex Auth
I verified both Convex Auth and (Clerk + Convex) providers. For both solutions, it seems that the app unmounts for some reason between navigations until the auth state is determined. So even when I am authenticated and navigate between protected routes, the issue remains, and the isAuthenticated state is reset on page navigation.
_authed.tsx:
app.tsx:
CC: @ballingt we disscused that issue a bit, I think it's good to have seperate topic about that
6 Replies
Thanks for posting in <#1088161997662724167>.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.
- Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
- Use search.convex.dev to search Docs, Stack, and Discord all at once.
- Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI.
- Avoid tagging staff unless specifically instructed.
Thank you!
Like I mentioned above, same issue with Contex Auth Provider:
_authed.tsx
app.tsx
Following this discussion.. I’ve been encountering the same issue
I think I am doing something wrong, because it does the same thing without convex (tried with supabase)
I need to say it's Tanstack Router issue, or skill issue 😄
I created my own provider:
and use beforeLoad:
and it still share the same issue
I also checked with react router, and it shares the same issue
Outlet with
<AppSidebar />
gets unmounted every time I do page navigation.Seems like the auth state is not persistent between page navigations, because each time I navigate to a different page, I see this:
CC: @Tom
any ideas?