NuxtN
Nuxt11mo ago
4 replies
Leo

NuxtHub Environment Variables not working

Hey,
I have a problem with the deployment of my Nuxt application on NuxtHub: my environment variables aren't working.

My Nuxt Config:
runtimeConfig: {
    public: {
      POCKETBASE_ADDRESS: process.env.POCKETBASE_ADDRESS,
      PRESALE_SPECIAL_REGULAR_PRICE: process.env.PRESALE_SPECIAL_REGULAR_PRICE,
      PRESALE_SPECIAL_DISCOUNT_PRICE:
        process.env.PRESALE_SPECIAL_DISCOUNT_PRICE,
      PRESALE_REGULAR_PRICE: process.env.PRESALE_REGULAR_PRICE,
      PRESALE_DISCOUNT_PRICE: process.env.PRESALE_DISCOUNT_PRICE,
    },
  },


And yes, I know that I haven't created all of the environment variables which I'm using, but thats not the problem, because the content of the runtime config looks like this, if I print it in production:

{
POCKETBASE_ADDRESS: '', 
PRESALE_SPECIAL_REGULAR_PRICE: '', 
PRESALE_SPECIAL_DISCOUNT_PRICE: '', 
PRESALE_REGULAR_PRICE: '', 
PRESALE_DISCOUNT_PRICE: ''
}
image.png
image.png
Was this page helpful?