I’m encountering an issue with my Next.js 14 project deployed on Vercel, using Supabase for authentication. The problem started after initiating a new build for a recent PR, despite no changes to the authentication-related code or even without any change. Here's the detailed situation:
Issue Description:
- Old Build Behavior: The older build (from three days ago) works perfectly in production, staging, and the old preview link. Authentication functions as expected, and users remain logged in after login.
- New Build Behavior: After deploying the new build for the PR, users are redirected to the login page immediately after logging in. This occurs in the preview environment of the new build.
- Code Changes: No code changes were made in the PR(empty commit) so that The issue seems tied to the new build process itself.
Steps Taken:
- Verified that the older builds (production, staging, and old previews) are working correctly.
- Confirmed no changes were made to authentication logic or Supabase integration in the recent PR.
- Ensured Supabase settings and environment variables remain consistent across builds.
Environment Details:
- Framework: Next.js 14
- Hosting: Vercel
- Auth Provider: Supabase
- Build Status: Old builds work fine, new build preview exhibits the issue.
Request for Assistance:
I’m looking for help in diagnosing the cause of this issue and resolving it. I would appreciate any guidance or suggestions on where to look or what to test.