Regression in loading .env file from 2.2.0 to 2.2.2 for prisma/cli
See original GitHub issueBug description
When upgrading from @prisma/cli from 2.2.0 to 2.2.2 it does not load the .env
file from the working directory, like the prisma client does. We already had prisma-client at 2.2.2 because dependabot merged that PR first.
Fun fact: if you put the DATABASE_URL
from the .env
file back in the prisma/.env
file, the client doesn’t work any more (because it doesn’t have the DATABASE_URL
) but npx prisma migrate up
works again 🤷 .
How to reproduce
Breaking CLI:
- Upgrade CLI and Client to 2.2.2
- Place a
.env
file with theDATABASE_URL
in the working directory, and none inprisma/
. - run regular prisma code -> it works
- run
npx migrate up --experimental
-> it breaks
Breaking the normal client:
- Upgrace CLI and Client to 2.2.2
- Create a
prisma/.env
file with theDATABASE_URL
and no.env
file in the working directory. - run regular prisma code -> it breaks (using the default empty constructor
new PrismaClient()
) - run
npx migrate up --experimental
-> it works again
Environment & setup
- OS: Mac OS
- Database: Postgres
- Prisma version:
2.2.2
- Node.js version: 14.4
Related to #2971
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
Issues
Load the env file from the prisma folder as before. Environment & setup. OS: Mac OS; Database: PostgreSQL; Prisma version: 2.2; Node.js version: ......
Read more >Environment variables
Any environment variables defined in that .env file will automatically be loaded when running a Prisma CLI command. Do not commit your .env...
Read more >Prisma - Getting Environment Variable Not Found Error ...
Any environment variables defined in that.env file will automatically be loaded ... Regression in loading.env file from 2.2.0 to 2.2.2 for prisma/cli #3086 ......
Read more >Not reading ENV variables in database.yml (Rails 4.2.0, ...
The issue was solved by putting two lines in my application.rb file to load Dotenv earlier: ... Bundler.require(*Rails.groups) #### ...
Read more >Environment variables — dynaconf 2.2.3 documentation
To override the configuration parameter {param}, use an environment ... values in a .env file located in the same directory as your settings...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
In Setup 2, Prisma Client should totally work if you have
env("DATABASE_URL")
in your schema.If not, can you create a super simple project reproducing the problem and just put it on GitHub so we can verify?
Sorry guys haven’t found the time to isolate the issue in a fresh repo. I’ll try to do it in the coming weeks, but feel free to close the issue and have me re-open it if I can confirm, if that helps you manage this repo better!