vercel / platforms

A full-stack Next.js app with multi-tenancy and custom domain support. Built with Next.js App Router and the Vercel Domains API.
https://app.vercel.pub
5.38k stars 688 forks source link

Code deployment build error - no env variable found #414

Closed TanmayKumar-EngStud closed 1 week ago

TanmayKumar-EngStud commented 1 week ago

I am new to learning NextJS, I am following the official guide to learn NextJS. I reached to Chapter 6 where we set up our database. I have followed the steps of all the previous carefully. So firstly we are deploying the code on vercel and later we are going to set up postgre. But at the time of deployment, I am getting a build error that in some file there is an environment variable called POSTGRES_URL, and that environment variable is not found.

image

I know that we can't push .env file on github from where vercel automatically re-deploys the code. Moreover POSTGRES is suppose to set up later, after deployment. Then how would I will be having the POSTGRES_URL information.

Should there be change in Chapter 6?

TanmayKumar-EngStud commented 1 week ago

fixed it! need to create a Postgres database in the vercel where I deployed the code, after creation, we need to re-deploy the code.