URGENT: NETLIFY_SITE_ID is undefined in Function Runtime -> @netlify/blobs Fails

Hi Netlify Community & Support,

I’m blocked on my site clipcleanse-app (Site ID: 41bc8e53-ebb3-4731-91c9-e904f17b15ec) because essential Netlify environment variables like process.env.NETLIFY_SITE_ID are undefined when my functions run.

Problem:

My functions can’t access NETLIFY_SITE_ID. This causes @netlify/blobs to fail with MissingBlobsEnvironmentError because it needs that ID.

Evidence:

  1. A simple test function (netlify/functions/api/env-test.cjs) logs NETLIFY_SITE_ID: undefined.
  • Other env vars like SITE_NAME and URL are present. CONTEXT and DEPLOY_URL are also undefined.
  1. My pickup-code.cjs function, which uses getStore(), fails due to this.

  2. My build process is correct: Build logs show my netlify.toml command runs, functions are copied to dist/functions/api/, and Netlify packages them from there. (Happy to share logs).

This seems like a Netlify platform issue where standard env vars aren’t being injected into my function’s runtime for this site.

I’ve cleared cache & redeployed, checked all configs.

How can I get NETLIFY_SITE_ID (and other standard vars) correctly populated in my functions so @netlify/blobs can work?

Thanks!

You don’t need to set that as an enviroment variable. It gets auto-populated for you when using @netlify/blobs in Netlify Functions and Edge Functions.

1 Like