Skip to content

Improve error messages for CLI flags, type generation, auth scopes, dev server tunnels, and compatibility flags#14241

Merged
dario-piotrowicz merged 4 commits into
mainfrom
dario/fix-miscellaneous-wrangler-errors
Jun 13, 2026
Merged

Improve error messages for CLI flags, type generation, auth scopes, dev server tunnels, and compatibility flags#14241
dario-piotrowicz merged 4 commits into
mainfrom
dario/fix-miscellaneous-wrangler-errors

Conversation

@dario-piotrowicz

Copy link
Copy Markdown
Member

Error messages across several areas now name the exact flags or values involved and suggest how to fix the problem:

  • demandOneOfOption (used by KV commands): messages now include -- prefixes and clear "Missing required option" / "Conflicting options" phrasing instead of the vague "Exactly one of the arguments ... is required".
  • wrangler types --include-env=false --include-runtime=false: the error now names both flags and explains what each does.
  • wrangler login --scopes: invalid scopes are individually identified instead of dumping the entire array.
  • wrangler dev --tunnel --remote: the error now explains why tunnels require local mode and suggests two concrete fixes.
  • Conflicting compatibility flags (nodejs_compat_populate_process_env / nodejs_compat_do_not_populate_process_env, global_navigator / no_global_navigator): errors now name the specific conflicting flags.

  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: improved error messages

A picture of a cute animal (not mandatory, but encouraged)

@changeset-bot

changeset-bot Bot commented Jun 9, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1c3b0c5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
wrangler Patch
@cloudflare/vite-plugin Patch
@cloudflare/vitest-pool-workers Patch
@cloudflare/wrangler-bundler Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@ask-bonk

ask-bonk Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

UnknownError: ProviderInitError

github run

@ask-bonk

ask-bonk Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

@dario-piotrowicz Bonk workflow failed. Check the logs for details.

View workflow run · To retry, trigger Bonk again.

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

✅ All changesets look good

@pkg-pr-new

pkg-pr-new Bot commented Jun 9, 2026

Copy link
Copy Markdown
create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@14241

@cloudflare/deploy-helpers

npm i https://pkg.pr.new/@cloudflare/deploy-helpers@14241

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@14241

miniflare

npm i https://pkg.pr.new/miniflare@14241

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@14241

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@14241

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@14241

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@14241

@cloudflare/workers-auth

npm i https://pkg.pr.new/@cloudflare/workers-auth@14241

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@14241

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@14241

wrangler

npm i https://pkg.pr.new/wrangler@14241

commit: 1c3b0c5

@ask-bonk

ask-bonk Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

The scope code is well-guarded (args.scopes truthy, length > 0, validation guarantees at least one invalid). The logic is sound.

Let me do a final scan: telemetry messages were preserved (good — AGENTS.md says they should be stable static labels, and they weren't changed even though wording changed). All static telemetry labels remain unchanged.

I've reviewed all 13 files. The changes are:

  • Pure error-message improvements with matching test snapshot updates
  • The demandOneOfOption refactor actually fixes a latent array-mutation bug (options.pop())
  • Telemetry labels correctly kept stable
  • Scope filtering logic is sound; the DefaultScopeKeys vs DefaultScopes divergence is theoretical only (setLoginScopeKeys never called in production)
  • Changeset present and correctly scoped to wrangler patch

No logic bugs, security issues, backward-compatibility violations, or incorrect API behavior. The only theoretical concern (scope set divergence) cannot occur in practice and would be a nitpick.

LGTM

github run

@dario-piotrowicz dario-piotrowicz marked this pull request as ready for review June 9, 2026 21:33
@workers-devprod workers-devprod requested review from a team and ascorbic and removed request for a team June 9, 2026 21:33
@workers-devprod

workers-devprod commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • @cloudflare/workers-kv
  • ✅ @cloudflare/wrangler
Show detailed file reviewers
  • packages/wrangler/src/tests/kv/key.test.ts: [@cloudflare/workers-kv]
  • packages/wrangler/src/kv/index.ts: [@cloudflare/workers-kv]

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@dario-piotrowicz dario-piotrowicz force-pushed the dario/fix-miscellaneous-wrangler-errors branch from 3010fa8 to 3d8c389 Compare June 10, 2026 00:27
devin-ai-integration[bot]

This comment was marked as resolved.

Comment thread packages/wrangler/src/core/helpers.ts Outdated
Comment thread packages/wrangler/src/core/helpers.ts Outdated
Comment thread packages/wrangler/src/kv/index.ts Outdated
Comment thread packages/wrangler/src/dev.ts
@github-project-automation github-project-automation Bot moved this from Untriaged to In Review in workers-sdk Jun 12, 2026
devin-ai-integration[bot]

This comment was marked as resolved.

@petebacondarwin petebacondarwin removed the request for review from ascorbic June 12, 2026 21:11

@petebacondarwin petebacondarwin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codeowners Bypass

(KV is requested but this is a trivial change to error messages and not worth blocking on)

@workers-devprod workers-devprod left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codeowners reviews satisfied

@github-project-automation github-project-automation Bot moved this from In Review to Approved in workers-sdk Jun 12, 2026
@dario-piotrowicz dario-piotrowicz merged commit 8b2ce41 into main Jun 13, 2026
61 checks passed
@dario-piotrowicz dario-piotrowicz deleted the dario/fix-miscellaneous-wrangler-errors branch June 13, 2026 15:52
@github-project-automation github-project-automation Bot moved this from Approved to Done in workers-sdk Jun 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants