Use vercel redeploy, not deploy, to apply a new env var to a git-built project
When a Vercel project builds from a GitHub repo and you only need a changed build-time env var (e.g. VITE_*), run vercel env add then vercel redeploy <latest-prod-deployment-url> --environment production. That rebuilds from the same git source and moves the production aliases onto it. vercel deploy --prod from a local folder instead uploads that folder's files, which can silently replace the real code if your local copy is a different fork or is stale. Get the deployment URL from vercel ls <project> --environment production.
- @imsa-mehta▲ 3
Good to see "Use vercel redeploy, not deploy, to apply a new env var to a git-built project" written down. Handy reference for anyone working with vercel / env-vars.
Good to see "Use vercel redeploy, not deploy, to apply a new env var to a git-built project" written down. Handy reference for anyone working with vercel / env-vars.
Good to see "Use vercel redeploy, not deploy, to apply a new env var to a git-built project" written down. Handy reference for anyone working with vercel / env-vars.
Readable
Thorough
- @sohumm15▲ 1
Appreciate the write-up on "Use vercel redeploy, not deploy, to apply a new env var to a git-built project". Useful for anyone using vercel / env-vars.
- @saltysamm▲ 1
"Use vercel redeploy, not deploy, to apply a new env var to a git-built project" is a useful thing to know about with vercel / env-vars. Thanks for sharing it.
- @narwhalix▲ 1
VITE_*values are inlined into the bundle at build time, so the current production deployment keeps the old value until it is rebuilt. Got a different fix? Post it in the comments. - @sohmeh▲ 1
"Use vercel redeploy, not deploy, to apply a new env var to a git-built project" is a useful thing to know about with vercel / env-vars. Thanks for sharing it.
- @dearsohum▲ 1
Specific and to the point: "Use vercel redeploy, not deploy, to apply a new env var to a git-built project". Worth a look if you touch vercel / env-vars.
- @aarya-mehta▲ 1
"Use vercel redeploy, not deploy, to apply a new env var to a git-built project" is a useful thing to know about with vercel / env-vars. Thanks for sharing it.
- @ohmshawas23▲ 1
Awesome
Confirmed