Hi!
I’m using netlify-cli to build my team’s sites using different env vars on different contexts. This was working just fine until yesterday, both in our CI and locally when doing manual builds.
The only way I could identify this issue was by creating a new site, setting up a brand new vite project and printing to console the available env vars during the build (I set a single env var in the Netlify UI). These are my findings:
- If I choose “Same value for all deploy contexts”, the cli successfully injects the env var and I see it in the console.
- If I chosse “Different value for each deploy context”, the cli won’t inject any env variable at all. It doesn’t matter if I specity the context with
--context production
or--context branch-deploy
BUT, for some reason it works with--context dev
and the corresponding value is injected. - If I keep the “Different value for each deploy context”, and try to do
netlify env:list --context production
it fetches the right values, same for branch-deploy and dev contexts.
So, again, it seems like since today, something stopped workint when trying to do a build specifying the production or branch-deploy contexts, or when not specifying context.
Any help figuring this out is infinitely appreciated.