Why useSession() Is undefined on First Load in Next.js When Deployed to Production (and how i fixed it)
When i Deployed my Saas (next.js app) in production i noticed something strange. On the first load my console showed session undefined but when i refreshed the page ie /dashboard everything worked perfectly. Even More Confusing that this never happen...
Jan 14, 20262 min read9