Next.js Discord

Discord Forum

Deployment with custom domain not updating with new environment

Unanswered
Blanc de Hotot posted this in #help-forum
Open in Discord
Blanc de HototOP
I have a production branch prod-branch-name that has its own environment variables assigned in Vercel environment variable settings. Works great!

I have another branch, let's call it feat/registration that is assigned a domain, let's say my-team-feat-registration.vercel.app.
This branch was deploying preview deployments using custom environment variables specifically assigned to this branch, and it was building fine and dandy-- until I decided to update these said environment variables.

First of all, the latest build refused to build via vercel from Vercel CLI or from the Redeploy from branch deployments, when it was building and running fine locally.

Second, when I just pushed vercel --prebuilt instead since the local build was fine, it did end up deploying on a preview. However, this preview did not use an updated version of the environment variables. (The local deployment did.)

I've double-checked my environment variables, removed them, then re-added them, but still the newly created preview links are not using updated environment variables. Also tried vercel --force.

Lastly, the custom domain stopped being assigned to the preview branches. :(

What in the world could be going on here? I cannot clear the data cache because the project is tied to the stable production branch and I'm afraid it'll break the branch if I clear the data cache.

1 Reply

Blanc de HototOP
Versions for reference:
- Next.js 13.4.19
- Node.js 18.x

Builds with Next.js