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
They are
Oddly enough - VAR_NAME works but NEXT_PUBLIC_VAR_NAME doesnt.
Do you prune those out?
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.
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 buildso 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
they're all explicitly passed to the command