Vercel System Environment Variables not loaded in development

Hi,

Suddenly when I pull environment variables from Vercel, system environment variables like VERCEL_ENV (and everything else) is missing when --environment is not preview or production.

I am running the latest version of Vercel CLI (41.0.2)

This used to work for a number of years, and we have a whole number of build tools using VERCEL_ENV to configure projects successfully. It is also mentioned in the Vercel documentation that these are available in all environments.

1 Like

Hi @zigavajdic, welcome to the Vercel Community!

As per the docs, the system variables are available in all environments on Vercel, which is different than using the Vercel CLI to pull the environment variables locally.

May I know when was the last time you pull VERCEL_ variables using the CLI successfully? Because it shouldn’t be possible.

Hi Anshuman,

I think based on the current state of the documentation, it is hard to infer that you only mean Vercel environments, and that development doesn’t imply the VERCEL CLI environment on a local machine. Also it seems this wasn’t always the case as per this open issue [cli] Removing VERCEL_ENV in vercel@34.2.0 is a breaking change · Issue #11633 · vercel/vercel · GitHub.

I can’t tell you exactly when it stopped working. Unfortunately I don’t know what my latest vercel version was before updating the CLI tool.


1 Like

Hi @zigavajdic, thanks for sharing the feedback about the docs. I’ll pass it along to the docs team. About the CLI pulling in the VERCEL_ envs, let me confirm with the team if there are alternatives.

1 Like