question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

prisma2 commands do not recognize environment variables.

See original GitHub issue

Hi,

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: Screen Shot 2019-07-02 at 3 44 27 PM


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:closed
  • Created 4 years ago
  • Reactions:9
  • Comments:13 (10 by maintainers)

github_iconTop GitHub Comments

8reactions
timsuchanekcommented, Jul 11, 2019

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.

5reactions
timsuchanekcommented, Jul 23, 2019

@nickreynke good point! Support for .env files has been added to 2.0.0-preview-2. We’ll resolve this issue in 2.0.0-preview-3.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found