Error deploying to vercel from Git with Neon Prism Database

I’ve been working on a project learning how to create in next.js and I’m at the point of trying to setup a database.

When trying to deploy from git with vercel --prod I receive the following error

Environment Variable “DATABASE_URL” references Secret “DATABASE_URL”, which does not exist.

In vercel - settings i have ensured the DATABASE_URL is set for all environments and that the URL matches what is in my code.

Any help to understand how to resolve this would be appreciated. Thank you!


This is my project setup:

I created a database in neon and linked to my project.

I setup all the structures and code as follows:

.env (contains all the links from the neon dashboard)
/lib/pismaClient.js
/prisma/schema.prisma which references DATABASE_URL

package.json includes
“scripts”: {
“dev”: “next dev”,
“build”: “prisma generate && next build”,

Here is my app structure

Everything is working locally when testing.

The setup I have for my project is:

GIT - code and VSCODE
Vercel - Deployment
Neon - Database linked in Vercel

Hi All,

I resolved this issue.

It was that I reference DATABASE_URL in my vercel.json file.

By removing it I was able to deploy correctly.

Thanks

1 Like

Hi @muellerjono-gmailcom, thanks for sharing your solution in the community.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.