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

TURBO REPO (Error: [prisma-field-encryption] Error: no encryption key provided.) #128

Open
freddydrodev opened this issue Oct 19, 2024 · 2 comments

Comments

@freddydrodev
Copy link

Issue description

Hi there, Thank you for that amazing package.
I have tried to use this package with turbo repo and it was working fine on local
But when I have put it in production (Vercel), I have got the following issue

Error: [prisma-field-encryption] Error: no encryption key provided.

What I have Tried

  1. I have put the encryption key on my vercel project as always, (this was already made on first deployement)
  2. Then I have changed the key name from my own to "PRISMA_FIELD_ENCRYPTION_KEY" as mentioned in your docs
    But I still get the same issue

Solution found

Finally I had to take all my local env to .env.local (not version controlled) an encryption key to .env(version controlled) that is not secure. My project is private and I am alone on I think this is not secure. By the way it is working with this solution

Version

{
 "prisma": "^5.21.0",
 "prisma-field-encryption": "^1.6.0"
}
@franky47
Copy link
Member

Have you declared the variable in your turbo.json file?

https://turbo.build/repo/docs/crafting-your-repository/using-environment-variables

The fact that all variables need to be whitelisted there, even if they are available on Vercel has bit me more than once.

The latest Turborepo update has a mechanism to warn you about undeclared variables.

https://turbo.build/blog/turbo-2-2-0

@freddydrodev
Copy link
Author

Have you declared the variable in your turbo.json file?

https://turbo.build/repo/docs/crafting-your-repository/using-environment-variables

The fact that all variables need to be whitelisted there, even if they are available on Vercel has bit me more than once.

The latest Turborepo update has a mechanism to warn you about undeclared variables.

https://turbo.build/blog/turbo-2-2-0

Thanks for your response I check it and come back to you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants