#8544 NODE_VERSION env var not taking effect on Pages
Dashboard env vars ignored when wrangler config file present - source-of-truth conflict. Maintainer acknowledged, tracked internally (DEVX-1279). Related PRs merged (#10314, #10393, #11229) but core issue not resolved.
Document behavior clearly; complete DEVX-1279 work for config conflict detection; add warning when deploying with wrangler config
Analysis Report
Issue #8544: NODE_VERSION environment variable not taking effect on Cloudflare Pages
Summary
- Status: OPEN
- Created: 2025-03-18
- Updated: 2025-10-30
- Labels: bug
- Reporter: arnewc
Issue Description
User reports that setting NODE_VERSION=22.14.0 as an environment variable in the Cloudflare Pages dashboard does not take effect. The build logs show Node.js 18.17.1 being used instead, causing Next.js builds to fail (requires Node.js >=18.18.0).
Analysis
Root Cause Identified
A community member (@ammarmbe) identified the root cause in the comments:
"I had the same problem, apparently if you have a wrangler config file in your project the env variables will be ignored, even if you don't have them set in the config."
This is a source-of-truth conflict between dashboard-configured variables and local wrangler.toml/wrangler.json configuration. When a wrangler config file exists in the project, dashboard environment variables are not applied.
Maintainer Response
Cloudflare maintainer @petebacondarwin acknowledged this as a known "source-of-truth problem" and referenced an internal ticket DEVX-1279 to add friction when users switch between dashboard and local config.
The maintainer explained the planned solution:
- Add validation to check difference between current deployment config and wrangler.toml config
- Require first wrangler.toml-driven deployment to match current config exactly
- If config doesn't match, fail deployment with instructions to use
wrangler pages download config
Work Done
Several related PRs have been merged to address the broader config diffing problem:
- PR #10314 (merged 2025-08-15): "Add information about dashboard configuration differences on deploys"
- PR #10393 (merged 2025-08-29): "Use resolved local config for remote deploy config diffing logic"
- PR #11229 (merged): Enabled
experimental-deploy-remote-diff-checkflag by default
These improvements help surface config conflicts but don't automatically resolve the NODE_VERSION case.
Workaround
The reporter found a workaround:
"I have successfully specified the Node.js version by creating a
.node-versionfile in my project."
Recommendation: KEEP OPEN
Reasoning
- Not fixed: The core issue (dashboard vars ignored with wrangler config present) is not fully resolved
- User impact: Causes confusing build failures with no clear error message
- Documentation gap: The behavior is not clearly documented, leading to user confusion
- Maintainer engagement: Internal ticket DEVX-1279 exists but full solution not yet implemented
- Recent activity: Updated Oct 2025, indicating ongoing relevance
Difficulty: Medium
Implementing proper config merging or validation requires careful consideration of all source-of-truth scenarios.
Suggested Actions
- Add a warning when deploying with wrangler config file present that dashboard environment variables may be ignored
- Document this behavior clearly in Cloudflare Pages documentation
- Complete the DEVX-1279 work to prevent foot-guns when switching between dashboard and local config
- Consider allowing explicit override of specific variables from dashboard even when wrangler config exists
Suggested Comment
This issue highlights the complexity of having two configuration sources (dashboard and local wrangler config). The core behavior is tracked internally (DEVX-1279), and recent improvements (PR #10314, #10393, #11229) have added better diffing and warnings when deploying.
Workarounds available:
- Use a
.node-versionfile in your project root (as the reporter discovered)- Add
varsconfiguration to your wrangler.toml/wrangler.json with the NODE_VERSION- Use
wrangler pages download configto sync dashboard settings to local configKeeping this open to track the need for better documentation and UX around this behavior.
Notes & Feedback (0)
No notes yet.