How to use environment variables without declaring them in runtimeConfig? #26333
Replies: 2 comments 2 replies
-
This should work. Where are you running your build? You need to make sure this environment has the env's set. For example, we use Github Actions to build and deploy. So we have to go into the repo's settings and manually add variables/secrets. |
Beta Was this translation helpful? Give feedback.
-
I have a similar issue that I described #26945 but in my case I already tried with adding NUXT_PUBLIC and still not working. Seems it is only possible to runtimeConfig detect the values in nuxt.config file and other configs like |
Beta Was this translation helpful? Give feedback.
-
Inside
nuxt.config.ts
I havebut the
process.env.URL
is undefined when I build and deploy it.the
process.env.URL
is defined when developing locally.I also tried setting a fallback value to
URL
butprocess.env.URL
would still be undefined. i.e. it is always the fallback value regardless of what I setURL
to inside.env
file.Question:
nuxt.confg.ts
without declaring them inruntimeConfig
?related issuese: #20860 #15931
Beta Was this translation helpful? Give feedback.
All reactions