Functions v2 / Scheduled Functions: User-defined environment variables are undefined at runtime

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:

  1. Scopes: Double-checked that ‘Functions’ and ‘Builds’ scopes are enabled for all variables.

  2. Contexts: Verified that variables are available in ‘All contexts’ (including Production).

  3. Deployment: Performed several ‘Clear cache and deploy site’ actions.

  4. Debugging: Logged Object.keys(process.env) at runtime; user-defined keys are physically missing from the list, while system keys (like SITE_ID) are present.

  5. Configuration: Tried forcing variables via [context.production.environment] in netlify.toml, but they still show as undefined.

  6. Local Testing: The variables work perfectly using netlify dev locally.

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!

Same issue.
Got it fixed after LONG hours of trial and error and finally found that redeploy via command line was the only way to get it fixed.

But this morning the same issue occurred again. So, definitely something going wrong at Netlify’s side

This is the command btw:
netlify deploy --prod --build --skip-functions-cache

Hi all, thanks for reporting this and we’re so sorry about this issue!

We currently have a status page up regarding env vars not being read at build time, and our engineers are currently investigating this with high priority! Please tune into the status page for updates.

Hey all,

Just a quick update on this one. We currently rolled out a fix and monitoring. Please do let us know if you continue to have issues.

The issue is resolved.