Error: $NEXT_STRIPE_SK is not listed as a dependency in turbo.json turbo/no-undeclared-env-vars #2942
-
I get the error in the title when running npm run build with Turborepo, does anyone know how to solve this issue? turbo.json
Random Nextjs API route file using that environmental variable
|
Beta Was this translation helpful? Give feedback.
Answered by
mehulkar
Jan 27, 2023
Replies: 2 comments 1 reply
-
It looks like your turbo.json config declares the env var: |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
mehulkar
-
Hey @mehulkar, I'm seeing similar error. But I've the correct name turbo.json {
"$schema": "https://turbo.build/schema.json",
"ui": "tui",
"tasks": {
"build": {
"dependsOn": ["^build"],
"inputs": ["$TURBO_DEFAULT$", ".env*"],
"env": ["AUTH_RESEND_KEY"],
"outputs": [".next/**", "!.next/cache/**"]
},
"lint": {
"dependsOn": ["^lint"]
},
"dev": {
"cache": false,
"persistent": true
}
},
"globalEnv": ["AUTH_RESEND_KEY"]
} |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It looks like your turbo.json config declares the env var:
STRIPE_SK
, but you're usingNEXT_STRIPE_SK
in your code. If you change one of them, the lint error should be resolved!