When executing prisma deploy -e database/.env.prod
from the parent directory of the prisma.yml
while having a .graphqlconfig
that points to database/prisma.yml
, instead of the .env.prod
being loaded, the .env
file is used instead.
I'm unable to get .env files working, even without the cli switch. When I create a new graphcool project via graphcool-framework/0.11.5
and add the twilio template and then create a .env file with the following
TWILIO_ACCOUNT_SID=BLAH
TWILIO_AUTH_TOKEN=BLOOP
and then run graphcool deploy
i see the following format of errors for TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN
/graphcool.yml: A valid environment variable to satisfy the declaration
â–¸ 'env:TWILIO_ACCOUNT_SID' could not be found.
I've tried using -e and --env-file also with no luck there either.
Hey @stephenhandley, this repository is about Prisma 🙂
Please report back in this repository with questions about Graphcool Framework. Thanks!
Any update ?
dotenv still does not work
Rename --dotenv to --env-file / -e
Update the doc please : https://www.prisma.io/docs/1.0/reference/cli-command-reference/database-service/prisma-deploy-kee1iedaov/
You are linking the version 1.0
documentation, @Kisepro. This is correctly documented. Compare to the 1.10
documentation, where --env-file
is used: https://www.prisma.io/docs/1.10/reference/cli-command-reference/database-service/prisma-deploy-kee1iedaov/.
@marktani Wow ok thanks. I never noticed that the default version was 1.0 for me.
But the issue can be close btw :-)
I am able to reproduce this: https://github.com/divyenduz/prisma-1701
Super helpful, thanks for this @divyenduz
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I don't think that this is resolved yet. Stale bot go away :)
What @divyenduz said 😂
Might be related: I'm running prisma deploy --env-file '/absolute/path/to/some/.env'
and it's telling me '--env-file path '/absolute/path/to/some/.env' does not exist`, even though I'm pretty sure it does.
Actually I think the issue is with this line - path.join(this.config.cwd, envFile)
won't work properly for absolute paths - methinks you meant path.resolve
rather than path.join
;-)
I am having the same issue except it's that I cannot load any file that's not called .env
. Using .env.prod
doesn't work, whether it's moved to /
or not @divyenduz .
I have tried:
prisma deploy --env-file .env.prod
prisma deploy -e .env.prod
None of those work and the .env.prod is never loaded, rather the .env file is always loaded and it only deploys locally.
I've ran into this issue before but somehow fixed it by commenting out https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/dotenv, but this workaround does not seem to work anymore.
I currently swap out the .env.prod
to .env
just to deploy to prod and vice versa since it still seems to read .env
properly.
This is not reproducible anymore. Please open a new issue in case the problem persists for you.
This happens when I run primsa generate, it can't read the env variables.
prisma generate -p ./prisma/auth/prisma.yml -e ./config/.env
! A valid environment variable to satisfy the declaration 'env:PRISMA_AUTH_ENDPOINT' could not be found.
Most helpful comment
I don't think that this is resolved yet. Stale bot go away :)