When running vercel deploy, the environment variable NEXT_PUBLIC_VERCEL_URL is populated correctly. However, when running vercel build and vercel deploy --prebuilt, this env var disappears.
Expected Behavior
NEXT_PUBLIC_VERCEL_URL should always get populated even if running vercel build and vercel deploy --prebuilt
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
I've also encountered this issue. I can see VERCEL_URL does work, but NEXT_PUBLIC_VERCEL_URL is not available in deployments created with vercel deploy --prebuilt
Verify canary release
Provide environment information
Which area(s) of Next.js are affected? (leave empty if unsure)
No response
Link to the code that reproduces this issue or a replay of the bug
https://github.com/Justinfan827/testing-vercel-cli
To Reproduce
compare the deployed site when running:
vs
Describe the Bug
When running
vercel deploy
, the environment variableNEXT_PUBLIC_VERCEL_URL
is populated correctly. However, when runningvercel build
andvercel deploy --prebuilt
, this env var disappears.Expected Behavior
NEXT_PUBLIC_VERCEL_URL
should always get populated even if runningvercel build
andvercel deploy --prebuilt
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
Vercel