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

moon run prisma:migrate exited with error "Environment variable not found" on Windows #96

Open
bludnic opened this issue Jan 9, 2025 · 1 comment
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@bludnic
Copy link
Member

bludnic commented Jan 9, 2025

I can confirm that this is reproducible only on Windows.

Reproduction steps:

  1. Follow installation steps from CONTRIBUTING.md

  2. Next, generate Prisma client:

moon run prisma:migrate

Command failed: "Environment variable not found"

image

Workaround:

If the command is executed as follows, it works fine:

pnpm exec prisma migrate dev --schema packages/prisma/src/schema.prisma

For some reason Prisma does not load the ENV variables from .env file, so the schema must be specified manually.

@bludnic bludnic added bug Something isn't working good first issue Good for newcomers labels Jan 9, 2025
@bludnic
Copy link
Member Author

bludnic commented Jan 9, 2025

There is a symlink in packages/prisma/.env pointing to the root .env file. It typically works on Linux and macOS, but may behave differently on Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant