TanStackT
TanStack3mo ago
6 replies
uncertain-scarlet

start-clerk-basic: Infinite redirect loop when refreshing session token

Hi! I am using the start-clerk-basic example, with set clerk env variables in
.env
. I can log in fine. However, when reloading the page, the vite server outputs this:
Clerk: Refreshing the session token resulted in an infinite redirect loop. This usually means that your Clerk instance keys do not match - make sure to copy the correct publishable and secret keys from the Clerk dashboard.

Also, the Clerk profile button in the topbar briefly flickers and renders the SignIn button. When adding a debug log into the fetchClerkAuth of the
__root
route, it shows that
userId
is null. So it seems like on the server side, we are not able to authenticate correctly with Clerk. Client-side then it works.
Was this page helpful?