Why it happens
Hosts scope environment variables per environment. A variable added while testing landed in Preview, or Development, and never in Production.
How to tell
- Runtime errors naming an undefined variable, in production only.
- The host's environment list shows the variable without the Production scope.
- The deploy's key names show it present in preview and absent in production.
The fix
- Add the variable to the Production scope and redeploy; variables are read at build or start, not live.
- Fail fast at startup: validate the required variables and refuse to boot with a message that names the missing ones.
- Keep a checked-in .env.example that lists every variable the app needs, with no values.
Where to look
The prompt for your builder
Paste this into Lovable, Bolt, Cursor, Claude Code or whatever built the app. Replace anything in capitals. It never asks you to paste a secret into a chat; keys go into your host’s environment, by you.
Add startup validation to my app that checks every required environment variable — list them from my code — and throws one clear error naming the missing ones before anything else runs. Also create .env.example with every variable and a one-line comment for each, without values.
How Keelnest catches it
Publish Verification reads the environment key names of each deploy — names only, never values — and compares them with the last verified publish, so a key that vanished is named in the incident. On Vercel and Netlify the preview of the branch is checked before it is promoted, so the missing key shows on the preview first.
Know the moment this happens.
Keelnest watches your production app every five minutes and tells you in plain English what broke — with the fix. Free for your first app.