Next.js Discord

Discord Forum

env variable does not expand

Unanswered
Giant Angora posted this in #help-forum
Open in Discord
Giant AngoraOP
Hello,
I recently deployed a project on Vercel and set an environment variable as follows:
NEXT_PUBLIC_SITE_URL=https://$NEXT_PUBLIC_VECEL_URL

However, Vercel doesn't seem to expand the variable, resulting in an error with my Open Graph image URL:
https://$NEXT_PUBLIC_VECEL_URL/twitter-image-zfyngs?a2fb9e0c16cd5c73

As you can see, the variable remains unexpanded in the URL."

1 Reply

Burmese
Your typo of NEXT_PUBLIC_VECEL_URL missing an "R" could have something to do with it? A more complete env solution that gives you errors rather than silently failing could be helpful.