Production and development env variables for generating client
I want a development env variable for when I run prisma generate so I keep it in a .env folder at the root. When in production though i want to use the environment variables provided by docker. Can I be sure the variable DATABASE_URL is being replaced with the production value If its still saying "Environment variables loaded from .env"
5 Replies
You selected to wait for the human sages. They'll share their wisdom soon.
Grab some tea while you wait, or check out
#ask-ai if you'd like a quick chat with the bot anyway!If the client we to generate with wrong url or no url would i know? or would it cause downstream issues when passing a url to the client.
Prisma always reads environment variables from the system's environment. If DATABASE_URL is set in the environment (for example, by Docker), Prisma will use that value.
There was this related GitHub Issue:
https://github.com/prisma/prisma/issues/10104
Are you running into this?
GitHub
"Environment variables loaded from .env" is misleading · Issue #10...
Bug description I followed the "Running migrations on different environments" guide and executed this statement in my terminal: dotenv -e .env.test -- npx prisma migrate dev It was giving...
Solved
Thanks for letting us know 👍