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.
<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This bug report is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c1702">#c1702</a>)</em></sub></div>