Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Prisma] Environment variable not found: DATABASE_URL #189

Open
ghost opened this issue Nov 1, 2022 · 4 comments
Open

[Prisma] Environment variable not found: DATABASE_URL #189

ghost opened this issue Nov 1, 2022 · 4 comments
Assignees
Labels
🐞 Bug Something isn't working

Comments

@ghost
Copy link

ghost commented Nov 1, 2022

Describe the Bug (버그 설명)

prisma schema doesnt find the env variable

Version to Reproduce (현재 사용한 버전)

9.2

Steps to Reproduce (재현 순서)

image

prisma migrate dev --preview-feature

Prisma schema loaded from src\prisma\schema.prisma
Error: Schema validation error - Error (query-engine-node-api library)
Error code: P1012
error: Environment variable not found: DATABASE_URL.
  -->  schema.prisma:6
   | 
 5 |   provider = "sqlite"
 6 |   url      = env("DATABASE_URL")
   | 

Validation Error Count: 1
[Context: getConfig]

Prisma CLI Version : 4.5.0
@ghost ghost added the 🐞 Bug Something isn't working label Nov 1, 2022
@ghost ghost assigned ljlm0402 Nov 1, 2022
@ghost
Copy link

ghost commented Nov 8, 2022

Are there any workarounds to fix the issue? thanks.

@ahmadabbas02
Copy link

ahmadabbas02 commented Nov 9, 2022

Are there any workarounds to fix the issue? thanks.

I found a workaround by using dotenv cli as shown in prisma docs, you can find information here

In my case: dotenv -e .env.development.local -- prisma migrate dev --preview-feature

@ljlm0402
Copy link
Owner

ljlm0402 commented Nov 9, 2022

@HijackHornet

Thank you for good information.
We will reflect it after correction soon

@anthonydibi
Copy link

Still not fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants