Matt LuoM
Convex Community2y ago
21 replies
Matt Luo

Is <AuthLoading> necessary for handling an authenticated page?

I have a page in my Next.js v14.2.2 that is neither a public nor ignored route in my Clerk v4.30.1 middleware.ts file. In other words, if a user navigates to that page unauthenticated that user will see the Clerk sign-in page.

I am trying to understand why the application behavior is different between my Vercel prod deployment vs. any preview or local deployment.

Prod shows a blank page: https://crystaltxt.com/settings

Any Vercel preview deployment is working as expected with a rendered page:
https://crystal-txt-f4i5xg3l7-matts-projects-82cbe13a.vercel.app/settings

I am guessing the root cause may be because I am not using isLoading or AuthLoading module as defined in this docs page. Maybe Vercel prod loads faster or in a different order.
https://docs.convex.dev/auth/clerk#logged-in-and-logged-out-views
But even if the user is already logged in, they will still see a blank page in production.
Was this page helpful?