We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NITRO_
nitropack: 2.9.6
Environment variables dont seem to work on Cloudflare:
export default defineNitroConfig({ runtimeConfig: { myVar: '' }, });
This works locally with .env:
NITRO_MY_VAR="Hello world"
But deployed to Cloudflare with the environment set in Cloudflare Dashboard it stays empty. Using the following workaround it works:
runtimeConfig: { myVar: process.env.NITRO_MY_VAR, },
But what would then the purpose of defining NITRO_ env vars in the first place when they are not auto "injected"?
No response
The text was updated successfully, but these errors were encountered:
useRuntimeConfig
env
Do you call runtimeConfig(event) inside an event handler? Due to how late cloudflare provides environment (during request) it is a limitation.
runtimeConfig(event)
Sorry, something went wrong.
I do not. It works with the example above so in nuxt/nitro config the process env is there?
See also https://github.com/Atinux/nuxt-env-repro which gives this output (called from inside an event handler):
{ "runtimeConfig().hello": "", "runtimeConfig(event).hello": "world", "process.env.NUXT_HELLO": "world" }
might be you want to ensure NITRO_ env vars are passed to runtimeConfig by reassign them on request hook.
request
i'm facing only my env vars are passed to runtimeConfig.
and i reassign them to ensure they are all passed and voila, they are there all inside runtimeConfig.
reference #2575 (comment)
No branches or pull requests
Environment
nitropack: 2.9.6
Reproduction
Describe the bug
Environment variables dont seem to work on Cloudflare:
This works locally with .env:
But deployed to Cloudflare with the environment set in Cloudflare Dashboard it stays empty. Using the following workaround it works:
But what would then the purpose of defining
NITRO_
env vars in the first place when they are not auto "injected"?Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: