prisma2 commands do not recognize environment variables.
See original GitHub issueHi,
I have a project.prisma
file beginning with:
datasource db {
provider = "postgres"
url = env("POSTGRES_URL")
}
However, when I run either:
POSTGRES_URL=hello_world prisma2 generate
or
export POSTGRES_URL=hello_world; prisma2 generate
I get the following errors:
Additionally, running the commands:
export POSTGRES_URL=hello_world prisma2 generate
OR
export POSTGRES_URL=hello_world prisma2 dev
Both return with no console output.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:9
- Comments:13 (10 by maintainers)
Top Results From Across the Web
Environment variables - Prisma
An environment variable is a key value pair of string data that is stored on your machine's local environment. Refer to our Environment...
Read more >prisma - getting environment variable not found error message ...
If anybody running into this issue, just run npx prisma generate . This will re-establish the link between schema.prisma and .env file.
Read more >Re: Prisma's lack of `provider = env(...)` support in schema file
Hi there! I'm a bit bummed by the fact that I have to live with an uncomittable change in my schema.prisma file so...
Read more >What is Prisma and Why Do We Need Another ORM?
Unlike TypeORM and MikroORM, Prisma does not use classes or ... The .env file can be used for specifying environment variables such as ......
Read more >Prisma without typescript. Prisma information. We have the ...
createMany - it will not work; Try to use prisma client for the user model, i. ... A few other available commands are:...
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
We implemented the first version of a fix in
prisma2@2.0.0-preview-1
.Please note, that as of now the env vars are already interpolated in generation time, we’ll fix that in the coming days.
@nickreynke good point! Support for
.env
files has been added to2.0.0-preview-2
. We’ll resolve this issue in2.0.0-preview-3
.