For Vercel
This procedure is for Vercel.
Read the base symptom guideVercel production cannot read a required variable
A Vercel preview works while its production deployment fails to connect to the same kind of service.
Keep the failing production deployment open while checking project settings. Vercel distinguishes Production, Preview and Development environments. The same variable name can have a different value or be absent in one of them. Your goal is to establish what configuration belongs to this deployment, not to make all three environments identical.
01 / Procedure
The two-minute check.
- Identify the actual production deployment.
Open the Vercel project and select Deployments. Select the deployment used by your live domain. Record its environment, source revision and creation time, then open its deployment URL to reproduce the failure there.
- Inspect the variable’s scope.
Open the same project’s Settings, Environment Variables. Find the exact name from the integration code and check that Production is selected. Compare names, not screenshots of secret values. A Development-only entry is not proof that production has the setting.
- Read the build’s own evidence.
Return to the selected deployment and expand Building to view its build logs. Find the first relevant configuration failure and the command being executed. Do not add a command that echoes secrets into these logs.
- Check whether a rebuild is needed.
Compare the variable change with the deployment’s creation time. Vercel applies variable changes to new deployments. After saving the intended production configuration, create a new deployment and test its own URL with the original failing action.
02 / Evidence
Read the result.
WORKSThe new Vercel production deployment completes the previously failing integration.
BROKENThe required setting is absent from Production or the deployment still reports the same failure.
03 / Repair
Causes and fixes.
Ranked in the order to investigate, not by claimed frequency.
- The setting exists only in Preview or Development.
Add the required value for Production in the correct project. Confirm the integration’s live account or project deliberately; a preview database may be inappropriate for real customer data.
- The live deployment predates the settings change.
Redeploy after saving the setting and verify the new deployment is the one serving production. Reopening an old immutable deployment URL still tests that older deployment, not the new configuration.
- The build expects a value in the wrong place.
Check whether the framework reads the setting at build time or in a server function. Move server secrets to server code and follow the framework’s public-variable rules only for safe browser configuration.
04 / Limits
Edge cases.
- A branch-specific preview setting does not establish the production setting. Inspect the environment on the deployment itself before reasoning from a working preview.
- A completed build may still have a runtime integration failure. Reproduce the server action after deployment; the absence of a build error is not proof that the service connection works.
When to stop and hand it over
Hand over if the variable is present for Production and a fresh deployment still fails. Include the variable name, source revision, deployment time and redacted build or request error. Ask for the exact read location in code to be checked before changing more settings.
05 / Questions
Before the next attempt.
Does editing the variable change an existing deployment?
No. Vercel’s environment changes apply to new deployments, so retest a deployment created after the change.
Can I use the public prefix to make a secret readable?
That can expose the value to visitors. Repair where the code runs instead of publishing a server credential.