Keys and secrets
An environment variable is “undefined”
- What you see
- The app says a key is missing or
undefined. - Why it happens
- The name doesn't match, it's not set in that environment, or the app hasn't restarted since you added it.
- How to fix it
- Ask your agent to run the check that says “set” or “missing” for each variable.
- Fix the name or add the value yourself (VS Code for
.env.local, Vercel's website online). - Restart the app, or redeploy online.
Message for your agent
An environment variable is undefined. Run the env check (names only, never values), tell me which one is missing and where I should add it.
Safety
How to prevent it: Keep .env.example up to date with every name the app needs.
Was this page helpful?