How to get domain from process.env
#11438
Unanswered
technophile-04
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Question
Currently when you deploy Nextjs thorugh CLI or connect from github
process.env.NEXT_PUBLIC_VERCEL_URL
andprocess.env.VERCEL_URL
both gives the gated URL :( instead of giving public URLFor example :
Checkout : https://frames-se2.vercel.app console (I just logged
process.env.NEXT_PUBLIC_VERCEL_URL
)It logs :
The Vercel URL is: frames-se2-avnvagd82-technophile04s-projects.vercel.app
which is gated URLWhat breaks having gated URL ?
When having metadata setup, we have logic something like this :
Example code :
^ Now because vercel returns gated URL this breaks Open graph displaying images properly
Are their any better way to handle metadata then this ?
PS:
process.env.NEXT_PUBLIC_VERCEL_URL
used return public URL around 1 or 2 months ago and recently it started logging gated URLBeta Was this translation helpful? Give feedback.
All reactions