When I push code to my dev branch, vercel builds it correctly and deploys in the preview environment, but if I try to access it via the domain it generates (MYAPP-git-dev-MYPROJECTS.vercel.app) I get an error saying:
Application error: a server-side exception has occurred while loading MYAPP-git-dev-MYPROJECTS.vercel.app (see the server logs for more information).
The server logs show this error:
⨯ TypeError: Cannot read properties of null (reading ‘user’)
at v (.next/server/app/(app)/app/page.js:2:15068) {
digest: ‘951891281’
}
If I then merge this in my main branch, it deploys in my production environment, and I access my production URL it all works fine. Can anybody help me figure out why I cannot access the preview deployment?