Does Pages Build include user-specified ENV vars? They are not showing up

The docs say that builds include env vars: https://developers.cloudflare.com/pages/platform/build-configuration#environment-variables But when I console.log(process.env) the env vars are not there. Can someone from CF confirm that these vars are included during the build step?
Build configuration · Cloudflare Pages docs
You may tell Cloudflare Pages how your site needs to be built as well as where its output files will be located.
5 Replies
Walshy
Walshy15mo ago
They are
ianh.eth
ianh.eth15mo ago
Oddly enough - VAR_NAME works but NEXT_PUBLIC_VAR_NAME doesnt. Do you prune those out?
Walshy
Walshy15mo ago
Wut We don't run specific frameworks We just offer env vars like you get on Linux If a framework handles them differently, that's on them.
ianh.eth
ianh.eth15mo ago
yeah - no idea why but one shows up in process env and the other doesnt actually - the one is coming through via an explicit pass during the build step:
HYBRID_ENV=test yarn build
so I don't think its including user env vars that are specified in preview env im console logging during build step and its not showing up in the build logs
Walshy
Walshy15mo ago
they're all explicitly passed to the command
Want results from more Discord servers?
Add your server
More Posts