Hi Netlify Support,
I am experiencing a major issue where none of my user-defined environment variables are being injected into my Functions (v2 syntax) at runtime. This includes critical connection strings and configuration keys.
The Problem: Despite being correctly configured in the Netlify UI, process.env["MY_VAR"] and Netlify.env.get("MY_VAR") both return undefined during execution.
Attempts already made to resolve this:
-
Scopes: Double-checked that ‘Functions’ and ‘Builds’ scopes are enabled for all variables.
-
Contexts: Verified that variables are available in ‘All contexts’ (including Production).
-
Deployment: Performed several ‘Clear cache and deploy site’ actions.
-
Debugging: Logged
Object.keys(process.env)at runtime; user-defined keys are physically missing from the list, while system keys (likeSITE_ID) are present. -
Configuration: Tried forcing variables via
[context.production.environment]innetlify.toml, but they still show asundefined. -
Local Testing: The variables work perfectly using
netlify devlocally.
This seems to be a synchronization issue between the Netlify UI and the Function runtime environment, possibly related to the recent Environment Variables Issues reported on the status page.
Could a support engineer please look into my account’s environment sync? I cannot share my site details publicly, but you should be able to see the failing deployments on my latest project.
Thanks!