Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

process.env.URL null in nuxt project onvercel

I am deploying nuxt app on vercel. I added a secret to vercel environment following this guide - https://vercel.com/docs/environment-variables#secret-environment-variables

Locally I am using dotenv and it is working well, loading the variable from .env file into process.env.Token but process.env.Token is null when deployed on vercel.

How to solve this?

like image 838
mayank1513 Avatar asked Nov 07 '22 03:11

mayank1513


1 Answers

It's work for me in Nuxtjs, just set your name of environment variable starting with NUXT_ENV_

For example

process.env.NUXT_ENV_Token

Vercel will be automatically injected into the process environment.

like image 100
hamuesoh Avatar answered Nov 12 '22 17:11

hamuesoh