Vercel environment variables not working? You need to redeploy

Ship ItChecked against the official source

The short answer

Vercel only applies environment variable changes to new deployments: they are not applied to previous deployments. Your live version was built before you added the key, so you must redeploy your project to update the value. Also check which environment the variable is saved for: a variable set for Preview is applied to your next Preview deployment, not Production.

What to do

  1. Check that the variable is saved for Production, not only for Preview.
  2. Redeploy your project after you add or change a variable.
  3. Ask your AI tool: "List every environment variable this app reads, say whether it's used in the browser or on the server, and which ones must exist in Vercel Production."

Good to know

  • In a Vite app, only variables starting with VITE_ reach the browser code, which also means they're exposed in client-side source code. Never put a secret key in a VITE_ variable: secret keys belong in a server function.

Source

Checked on 8 Oct 2026. Prices, limits and settings change, so check the source before you rely on them.

Related