Vibe Unstuck

Free fixes / Card 1

Missing env vars on deploy

Symptom

App runs locally. On Vercel/Railway/etc. you get blank pages, 500s, or "undefined is not a function" around config.

Plain English

Your secrets and config live in a local .env file. That file never goes to the host. Production has empty values unless you paste them into the host dashboard (and rebuild).

Checklist

  1. Open your host's Environment Variables page.
  2. Copy every key from local .env (names only first).
  3. Paste matching values for Production (and Preview if you use preview deploys).
  4. Redeploy after saving env vars. Changing env alone does not always restart the old build.
  5. Confirm you did not commit .env (it should be in .gitignore).

Paste-ready fix prompt

Paste this into Cursor, Claude, Copilot, Lovable, Bolt, or whichever coding agent you use.

My app works locally but fails after deploy. Treat this as missing or mismatched environment variables first.

1. List every process.env / import.meta.env key my code reads.
2. Split which must be server-only vs which are safe as NEXT_PUBLIC_ / public.
3. Give me a checklist of exact keys to add in my host dashboard for Production and Preview.
4. Show me where to add a startup assert that throws a clear error if a required server env var is missing.
5. Do not rewrite features. Only make env loading and failure messages production-safe.

Still stuck?

This card covers the most common version of this break. If yours is different, send it in for a custom pass.

Get an unstuck pass