We were trying to do vercel env pull in our CI environment and noticed that the following fails, counter to our assumptions:
vercel env pull .env.preview \
--yes \
--environment Preview
Vercel CLI 49.1.2
> Overwriting existing .env.preview file
> Downloading `Preview` Environment Variables for X/Y
Error: Invalid request: 'target' value of 'Preview' references an environment that does not exist.
Whereas the following passes:
vercel env pull .env.preview \
--yes \
--environment preview
Vercel CLI 49.1.2
> Overwriting existing .env.preview file
> Downloading `preview` Environment Variables for X/Y
Changes:
+ VERCEL_OIDC_TOKEN (Updated)
✅ Updated .env.preview file [342ms]
So I wanted to know a few things:
- Is Vercel supposed to care about case-sensitivity of the deployment environment names — for both built-in (Production, Preview) and custom ones we create?
- And is the above just a bug in the CLI/backend, if that’s the case? It would seem like case-sensitivity matters, based on the error but then it’s confusing why Vercel dashboard would capitalize the environment name while the CLI expects lowercased name.
Another observation: I notice that when Vercel GitHub app is integrated, even the GitHub environment names that get created match the same case as defined on Vercel side. E.g. I created a staging environment and I noticed a similar env now exists in GitHub environments.
