Workers SDK Issue Reports

← Back to Dashboard

#10682 unrelated wrangler commands depend on parsing wrangler.jsonc

Recommendation:KEEP OPEN
Difficulty:medium
Reasoning:

Valid UX issue: config validation blocks unrelated commands. Active maintainer design discussion.

Suggested Action:

Defer validation errors to when config section is actually used

Analysis Report

Issue Review: cloudflare/workers-sdk#10682

Summary

Unrelated wrangler commands (like r2 bucket list) fail if wrangler.jsonc contains invalid configuration, even when the command doesn't need config.

Findings

  • Created: 2025-09-16
  • Updated: 2025-09-30
  • Version: wrangler 4.37.1 → 4.61.0
  • Component: wrangler
  • Labels: bug
  • Comments: 4

Key Evidence

  • User has invalid R2 bucket name in config (<prod-r2-bucket-name> with angle brackets from copy-paste of docs)
  • Running wrangler r2 bucket list fails due to config validation error
  • User can't list R2 buckets to find correct name to fix config
  • Maintainer @penalosa explained: Wrangler always parses config because commands may need it (e.g., D1 commands use binding names)
  • Design discussion ongoing between @irvinebroque, @penalosa, @petebacondarwin
  • @petebacondarwin suggested: "warn about potential problems but then only error if that bit of the config is used"
  • @irvinebroque argues: r2 bucket list should work independent of wrangler.jsonc

Recommendation

Status: KEEP OPEN

Reasoning: Valid UX issue with design implications. The current behavior creates a chicken-and-egg problem where users can't explore resources to fix their config. Maintainers are actively discussing solutions. The root cause is architectural (config always parsed upfront).

Action: Implement the proposed solution: defer validation errors to when the specific config section is actually used. Show warnings upfront but only error when invalid config is accessed.

Suggested Comment

N/A - Active maintainer discussion ongoing.

Notes & Feedback (0)

No notes yet.

Add Note