You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Only variables defined in .env files that are prefixed with NEXT_PUBLIC_ are being properly overridden when defined in a netlify.toml context. (I'm using Stripe keys only for illustrative purposes and wouldn't recommend putting the secret key in .env or netlify.toml)
It does specially processing for any environment variables starting with NEXT_PUBLIC_ and there is a some documentation (but not about this behavior) here:
I believe it is the runtime itself doing this. For example, if you tested this on a site that does not use Next.js or this plugin but you still made environment variables in both .env and netlify.toml you would not see the override behavior. This is because it is the plugin itself that is doing this override.
The text was updated successfully, but these errors were encountered:
Only variables defined in .env files that are prefixed with
NEXT_PUBLIC_
are being properly overridden when defined in a netlify.toml context. (I'm using Stripe keys only for illustrative purposes and wouldn't recommend putting the secret key in .env or netlify.toml)Example
In this example, after deploying to production, the environment variables will have the following values:
NEXT_PUBLIC_SITE_KEY
=live_site_456
SECRET_KEY
=test_secret_123
Next.js environment variables docs. Note that Next.js supports environment variables not prefixed with
NEXT_PUBLIC_
.We are using
@netlify/[email protected]
.I am opening the issue here since Netlify support pointed us in this direction:
The text was updated successfully, but these errors were encountered: