Vercel’s GitHub integration gets notified about the new branch and queues a build
Neon’s Vercel integration gets notified about the new preview environment and creates a database branch
Neon adds a new DATABASE_URL for the new branch & preview environment.
The problem we’ve been noticing is that the Vercel build starts before #3 can complete, so the first build of a new branch usually ends up failing due to the missing variable:
We don’t have a default preview DATABASE_URL (nor would we want one), and our build runs prisma migrate deploy as its last step, so we do need the preview environment’s actual database branch config.
It’s very annoying to have to go to in to Vercel and trigger a rebuild every time a new branch is pushed. How can I ensure that new branches don’t fail to build?
We’re aware of this issue, and we understand that it’s very inconvenient.
We’re working closely with the Vercel team this gets fixed. Unfortunately, there are no workarounds at the moment. I will let you know when the issue is resolved.
Having the same issue where the build fails due to missing environment variable. The guide you shared about is great @Mahmoud , but I’m not keen on maintaining a GitHub Actions workflow just to get this working.
Do you have any new ETA for resolving this issue? Thanks!