Home

Issue: 1902

Environment Variables Not Working on Now/Zeit Deploys

[issue link]

Using the latest Nuxt starter kit (1.0.0-rc11), I tried testing environment variables on Zeit’s Now deployment services and it’s not working.

nuxt.config.js

  env: {
    apiUrl: process.env.API_URL || 'http://local.dev/api'
  }

On deployment, it’s never setting apiUrl to the environment variable API_URL.

I have verified that the environment variables work in a basic app that is deployed with Now, so I think there is something weird going on with Nuxt.js and Now, or perhaps something SSR related that I’m unaware of?

The environment variables work when I deploy a static site to netlify though.

Any ideas?

It’s pretty easy to reproduce, just install the latest nuxt.js starter kit, add an env var and then deploy with Now.

This bug report is available on Nuxt.js community (#c1702)