#Can't access env vars in Workers build

12 messages · Page 1 of 1 (latest)

rotund comet
#

I'm migrating some Astro projects, that build static pages, from Cloudflare Pages to Cloudflare Workers. I'm following the migration tutotial and looking the docs. But I 'cant access the environment variables defined in wrangler.toml in process.env during or after the build.
I using the compat flags:
compatibility_flags = [ "nodejs_compat", "nodejs_compat_populate_process_env" ]
But in any moment i'm seeing the variables in log
Is there anything else i need to do?

zealous peak
rotund comet
zealous peak
rotund comet
zealous peak
rotund comet
zealous peak
#

For example, if you have a build variable configuring the version of Node you need to build your project, it wouldn't make sense to add that to the deployed Worker, and vice versa

rotund comet
zealous peak
#

Maybe the API?