-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
chore: make env mode strict by default #8182
chore: make env mode strict by default #8182
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
7 Ignored Deployments
|
8643947
to
37c3c59
Compare
🟢 Turbopack Benchmark CI successful 🟢Thanks |
🟢 CI successful 🟢Thanks |
37c3c59
to
e59b85c
Compare
let mut pass_through_env = EnvironmentVariableMap::default(); | ||
let default_env_var_pass_through_map = | ||
self.env_at_execution_start.from_wildcards(&[ | ||
"SHELL", | ||
// Command Prompt casing of env variables | ||
"APPDATA", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is necessary due to older versions of pnpm
not having pnpm/npm-conf#10 which results in pnpm
crashing if APPDATA
isn't defined.
Technically we could have users define this instead of baking it into turbo
itself, but considering the popularity of pnpm
and the amount of digging it took to find that PR, it seems nice to include it.
### Description Commandeered from #8151 Changes default env mode to strict and remove the "infer" option ### Testing Instructions Existing test suite (Currently some Windows integration tests are failing due to a missing env var, opening for review while I work on this) --------- Co-authored-by: nicholaslyang <nicholas.yang@vercel.com>
### Description Commandeered from #8151 Changes default env mode to strict and remove the "infer" option ### Testing Instructions Existing test suite (Currently some Windows integration tests are failing due to a missing env var, opening for review while I work on this) --------- Co-authored-by: nicholaslyang <nicholas.yang@vercel.com>
### Description Commandeered from #8151 Changes default env mode to strict and remove the "infer" option ### Testing Instructions Existing test suite (Currently some Windows integration tests are failing due to a missing env var, opening for review while I work on this) --------- Co-authored-by: nicholaslyang <nicholas.yang@vercel.com>
### Description Commandeered from #8151 Changes default env mode to strict and remove the "infer" option ### Testing Instructions Existing test suite (Currently some Windows integration tests are failing due to a missing env var, opening for review while I work on this) --------- Co-authored-by: nicholaslyang <nicholas.yang@vercel.com>
### Description Commandeered from #8151 Changes default env mode to strict and remove the "infer" option ### Testing Instructions Existing test suite (Currently some Windows integration tests are failing due to a missing env var, opening for review while I work on this) --------- Co-authored-by: nicholaslyang <nicholas.yang@vercel.com>
What was the motivation to change how environment variables are handled? I'm failing to understand based on your changelog's on turbo 2.0 and this PR (which you link from the changelog) WHY was this necessary. Why am I allowed to build and the environment variables aren't provided by default. My app if failing on vercel.com and the environment variables are there. Why do I need to be explicit on my turbo.json file to include variable A B or C? If the env variables are defined on my project dashboard then they all should be available. I'm running turborepo 2.0 and my build isn't working anymore. even with --env-mode=loose. Would be great to read somewhere why this change was necessary. |
Facing the same problem. After migration my environment variables are missing. Did you find a solution? |
Turbo 2 requires being explicit about the env vars consumed in each task (not inheriting the parent tasks') vercel/turborepo#8182
* chore: Update turborepo to v2 * chore: Fix env bursting for e2e run task Turbo 2 requires being explicit about the env vars consumed in each task (not inheriting the parent tasks') vercel/turborepo#8182
Have the exact same issue as both of you @Wizzel1 @andrevenancio ! I've tried using @chris-olszewski any idea what might be causing this?
|
Description
This change is being introduced to help users not accidentally hit cache. We've heard feedback that it's too easy to forget to add an
env
key, so this change will make it so your build fails when you do not have the variables needed available in the task runtime to build the package/application.Note: This isn't foolproof, since the app/package could gracefully handle the missing variable - but it should save a lot of user pain as far as hitting unintended caches.
Commandeered from #8151
Changes default env mode to strict and remove the "infer" option
Testing Instructions
Existing test suite
(Currently some Windows integration tests are failing due to a missing env var, opening for review while I work on this)