hwrd
1
I’ve set a secret with `fly secrets set API_URL=“foo” but with the configuration in Nuxt as
env: {
apiUrl: process.env.API_URL || 'http://localhost:8080'
},
Its still http://localhost:8080
in the application, whereas setting API_URL="foo" yarn dev
locally, it will pick up the environment variable.
I must be missing something on fly.io… any suggestions?
lubien
2
The issue is most likely on build time. I’ve wrote a little bit about it for NextJS but should be the same for Next too:
hwrd
3
Thanks for the suggestion. Looks like NuxtJS does this Nuxt - Nuxt configuration file
Unfortunately, I still haven’t gotten it to work.
hwrd
4
Ah looks like using the publicRuntimeConfig
works, but not privateRuntimeConfig
, because I was accessing the value in a client-side method.
1 Like