steven-tey / precedent

An opinionated collection of components, hooks, and utilities for your Next.js project.
https://precedent.dev
MIT License
4.65k stars 406 forks source link

Environment variable not found: POSTGRES_PRISMA_UR #50

Open masapasa opened 1 year ago

masapasa commented 1 year ago

npx prisma db push Prisma schema loaded from prisma/schema.prisma Datasource "db": PostgreSQL database

Error: Prisma schema validation - (get-config wasm) Error code: P1012 error: Environment variable not found: POSTGRES_PRISMA_URL. --> schema.prisma:11 10 provider = "postgresql" 11 url = env("POSTGRES_PRISMA_URL") // uses connection pooling

Validation Error Count: 1 [Context: getConfig]. I used npx vercel env pull .env to pull and also set export POSTGRES_URL_NON_POOLING= Can you please suggest @steven-tey ?

r-ohan commented 1 year ago

Definitely an issue with how this is configured. Prisma doesn't use the local environment variables without some hacking.

Just create a .env file and symlink it to your .env.local file. Like so:

ln -s .env.local .env