OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Can't access Environment Variables on Vercel using JavaScript

  • Thread starter Thread starter cc_haensel
  • Start date Start date
C

cc_haensel

Guest
I want to access env variables on Vercel using JavaScript (TypeScript). I have set them under /settings/environment-variables, but when i try to access them using process.env.TURSO_DATABASE_URL during buildtime I get undefined. I'm using @t3-oss/env-nextjs to validate my env variables, but it seems like, I can't even access them directly.

If I use the Vercel CLI to pull the variables into a .env file, all of them appear as expected.

vercel env vars

Any ideas on how to fix this?

<p>I want to access env variables on Vercel using JavaScript (TypeScript). I have set them under /settings/environment-variables, but when i try to access them using <code>process.env.TURSO_DATABASE_URL</code> during buildtime I get undefined. I'm using @t3-oss/env-nextjs to validate my env variables, but it seems like, I can't even access them directly.</p>
<p>If I use the Vercel CLI to pull the variables into a .env file, all of them appear as expected.</p>
<p><a href="https://i.sstatic.net/wiVmxwY8.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/wiVmxwY8.png" alt="vercel env vars" /></a></p>
<p>Any ideas on how to fix this?</p>
 

Latest posts

Top