`prisma db pull` doesn't read `.env` file and errors with Environment variable not found: DATABASE_URL
See original GitHub issueBug description
yarn prisma db pull report Environment variable not found: DATABASE_URL.
Prisma schema loaded from prisma/schema.prisma
Error: Get config: Schema Parsing P1012
error: Environment variable not found: DATABASE_URL.
--> schema.prisma:10
|
9 | provider = "postgresql"
10 | url = env("DATABASE_URL")
|
Validation Error Count: 1
.env: DATABASE_URL=“postgresql://user:pass@localhost:49154/db?schema=public”
How to reproduce
Expected behavior
read DATABASE_URL from .env correctly
Prisma information
Environment variables loaded from .env prisma : 3.9.0 @prisma/client : 3.9.0 Current platform : darwin-arm64 Query Engine (Node-API) : libquery-engine bcc2ff906db47790ee902e7bbc76d7ffb1893009 (at node_modules/@prisma/engines/libquery_engine-darwin-arm64.dylib.node) Migration Engine : migration-engine-cli bcc2ff906db47790ee902e7bbc76d7ffb1893009 (at node_modules/@prisma/engines/migration-engine-darwin-arm64) Introspection Engine : introspection-core bcc2ff906db47790ee902e7bbc76d7ffb1893009 (at node_modules/@prisma/engines/introspection-engine-darwin-arm64) Format Binary : prisma-fmt bcc2ff906db47790ee902e7bbc76d7ffb1893009 (at node_modules/@prisma/engines/prisma-fmt-darwin-arm64) Default Engines Hash : bcc2ff906db47790ee902e7bbc76d7ffb1893009 Studio : 0.457.0
Environment & setup
- OS: macOS 12.2
- Database: PostgreSQL 13
- Node.js version: v14.18.1
Prisma Version
Issue Analytics
- State:
- Created 2 years ago
- Reactions:7
- Comments:11 (5 by maintainers)
Top GitHub Comments
Hey, this issue has been fixed in 3.9.1 which was just published. Thanks for reporting this!
Hi @smoothdvd
Thanks for the report!
I can confirm this is a regression, we are working on a fix and are planning a patch release later today 🚢