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
  1. Ask your agent to run the check that says “set” or “missing” for each variable.
  2. Fix the name or add the value yourself (VS Code for .env.local, Vercel's website online).
  3. 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.

Still stuck?Report it to your agent, clearly

Hands-on test on Mac and Windows pending · Last reviewed Nov 8, 2026