gitnext.jsvercel

Deployment issue with Git, Vercel and Neon


I'm in the process of adding a Database to my web app. I am using Git (VSCode that pushes to Vercel and uses the Neon Database / prisma.

I've set up all the routing via documentation and have everything structured as it should however I can no longer deploy on vercel. From VScode it pushes only to git and not to vercel. In Git via that terminal if I run Vercel --prod I receive the following error:

Vercel CLI 41.4.1 Error: Environment Variable "DATABASE_URL" references Secret "DATABASE_URL", which does not exist.

I have checked all my routes and everything is correct, there should be no error with a Secret for DATABASE_URL. It does exist and is referenced in Neon correctly. I've tried a bunch of things with nothing being successful.

Any help to resolve would be greatly appreciated.


Solution

  • Remove those variables from vercel.json.

    Make sure you have your database environment variables configured properly on VERCEL Dashboard/Env. Vars.

    Update your local .env from vercel database: vercel env pull.

    that should get you going. I advise you do some reading on what env vars are (that's a huge value prop of using Vercel for multiple deployments and branched Databases, e.g. 1 DB branch per git branch/deployment).