Skip to content
New issue

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

docs: warn about using different env variables for runtimeConfig #24612

Merged
merged 5 commits into from Dec 5, 2023
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/2.guide/3.going-further/10.runtime-config.md
Expand Up @@ -56,6 +56,11 @@ There are two key requirements:

1. Only a specially-named environment variable can override a runtime config property. That is, an uppercase environment variable starting with `NUXT_` which uses `_` to separate keys and case changes.

::callout{color="amber" icon="i-ph-warning-duotone"}
Setting the default of `runtimeConfig` values to a *different environment variable* (for example setting `myVar` to `process.env.OTHER_VARIABLE`) will only work during build-time and will break on runtime.
danielroe marked this conversation as resolved.
Show resolved Hide resolved
It is advised to use the envrionment variables that match the structure of your `runtimeConfig` object.
danielroe marked this conversation as resolved.
Show resolved Hide resolved
::

#### Example

```sh [.env]
Expand Down