Skip to content

fix(workers-utils): standardize Zod validation errors - #15806

Merged
NuroDev merged 2 commits into
mainfrom
NuroDev/format-zod-validation-errors
Sep 24, 2026
Merged

NuroDev merged 2 commits into
mainfrom
NuroDev/format-zod-validation-errors

Conversation

@NuroDev

@NuroDev NuroDev commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

Use Zod's built-in prettifyError() helper for validation errors across Miniflare, Wrangler's experimental config, the Vite plugin, and the Vitest plugin. This removes the custom workers-utils formatter and its kleur dependency, and keeps property paths consistent across consumers.

The cf and Vite plugin v2 consumers are downstream follow-ups outside this repository.


  • 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: This only changes validation error formatting.

Note

This is a contribution from an AI agent: Codex, GPT-5.

@changeset-bot

changeset-bot Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9134267

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

This PR includes changesets to release 13 packages
Name Type
@cloudflare/vite-plugin Patch
@cloudflare/vitest-plugin Patch
@cloudflare/workers-utils Patch
miniflare Patch
wrangler Patch
@cloudflare/autoconfig Patch
@cloudflare/cli-shared-helpers Patch
@cloudflare/containers-shared Patch
@cloudflare/deploy-helpers Patch
@cloudflare/remote-bindings Patch
@cloudflare/runtime-types Patch
@cloudflare/workers-auth Patch
@cloudflare/pages-shared 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 Sep 23, 2026

Copy link
Copy Markdown
Contributor

Author identity unknown

*** Please tell me who you are.

Run

git config --global user.email "[email protected]"
git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: empty ident name (for runner@runnervmtr4k5.ckbuvmojxehurkfsktsxmhk5hb.cx.internal.cloudapp.net) not allowed

github run

@ask-bonk

ask-bonk Bot commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

@NuroDev Bonk workflow failed. Check the logs for details.

View workflow run · To retry, trigger Bonk again.

@pkg-pr-new

pkg-pr-new Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
@cloudflare/autoconfig

npm i https://pkg.pr.new/cloudflare/workers-sdk/@cloudflare/autoconfig@15806

@cloudflare/build-output-utils

npm i https://pkg.pr.new/cloudflare/workers-sdk/@cloudflare/build-output-utils@15806

@cloudflare/codemods

npm i https://pkg.pr.new/cloudflare/workers-sdk/@cloudflare/codemods@15806

@cloudflare/config

npm i https://pkg.pr.new/cloudflare/workers-sdk/@cloudflare/config@15806

@cloudflare/containers-shared

npm i https://pkg.pr.new/cloudflare/workers-sdk/@cloudflare/containers-shared@15806

create-cloudflare

npm i https://pkg.pr.new/cloudflare/workers-sdk/create-cloudflare@15806

@cloudflare/deploy-helpers

npm i https://pkg.pr.new/cloudflare/workers-sdk/@cloudflare/deploy-helpers@15806

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/cloudflare/workers-sdk/@cloudflare/kv-asset-handler@15806

miniflare

npm i https://pkg.pr.new/cloudflare/workers-sdk/miniflare@15806

@cloudflare/pages-functions

npm i https://pkg.pr.new/cloudflare/workers-sdk/@cloudflare/pages-functions@15806

@cloudflare/pages-shared

npm i https://pkg.pr.new/cloudflare/workers-sdk/@cloudflare/pages-shared@15806

@cloudflare/runtime-types

npm i https://pkg.pr.new/cloudflare/workers-sdk/@cloudflare/runtime-types@15806

@cloudflare/unenv-preset

npm i https://pkg.pr.new/cloudflare/workers-sdk/@cloudflare/unenv-preset@15806

@cloudflare/vite-plugin

npm i https://pkg.pr.new/cloudflare/workers-sdk/@cloudflare/vite-plugin@15806

@cloudflare/vitest-plugin

npm i https://pkg.pr.new/cloudflare/workers-sdk/@cloudflare/vitest-plugin@15806

@cloudflare/workers-auth

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

@cloudflare/workers-editor-shared

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

@cloudflare/workers-utils

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

wrangler

npm i https://pkg.pr.new/cloudflare/workers-sdk/wrangler@15806

commit: 9134267

@NuroDev
NuroDev marked this pull request as ready for review September 23, 2026 13:21
@workers-devprod
workers-devprod requested review from a team and dario-piotrowicz and removed request for a team September 23, 2026 13:21
@workers-devprod

workers-devprod commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

@devin-ai-integration devin-ai-integration Bot 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.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@dario-piotrowicz dario-piotrowicz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice improvement 😄 🚀

@NuroDev
NuroDev enabled auto-merge (squash) September 24, 2026 09:22

@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 Untriaged to Approved in workers-sdk Sep 24, 2026
@NuroDev
NuroDev merged commit 8fade73 into main Sep 24, 2026
62 of 63 checks passed
@NuroDev
NuroDev deleted the NuroDev/format-zod-validation-errors branch September 24, 2026 09:23
Wichtowski pushed a commit to Wichtowski/workers-sdk that referenced this pull request Sep 24, 2026
brandhaug added a commit to brandhaug/b2b-saas-starter that referenced this pull request Sep 27, 2026
## pnpm-workspace.yaml (default)

## Dependency Updates

| Package | From | To | Type |
| --- | --- | --- | --- |
| `wrangler` | 4.136.2 | 4.138.0 | minor |

## Release Notes

<details>
<summary><b>wrangler</b> (4.136.2 → 4.138.0) — 3 releases</summary>

<details>
<summary><b>4.138.0</b></summary>

### Minor Changes

- [#15776](cloudflare/workers-sdk#15776)
[`b03f960`](cloudflare/workers-sdk@b03f960)
Thanks [@<!---->edevil](https://github.com/edevil)! - Add event-code
support to temporary Worker deployments

Use `wrangler deploy --temporary --event-code <code>` to provision an
account for an event. Wrangler requires explicit server acknowledgement
before caching the account and keeps the event code out of its cache and
telemetry.

- [#15817](cloudflare/workers-sdk#15817)
[`6e77c53`](cloudflare/workers-sdk@6e77c53)
Thanks [@<!---->jamesopstad](https://github.com/jamesopstad)! - Allow
framework commands to produce Preview Build Output with the experimental
config

When `cf previews deploy` invokes a framework build command, Preview
intent is now preserved. Function-based `cloudflare.config.ts` files
receive `isPreview: true`, and generated Build Output is marked as a
Preview build.

### Patch Changes

- [#15806](cloudflare/workers-sdk#15806)
[`8fade73`](cloudflare/workers-sdk@8fade73)
Thanks [@<!---->NuroDev](https://github.com/NuroDev)! - Standardize Zod
validation error output

Format validation errors with Zod's built-in `prettifyError()` helper so
Miniflare, Wrangler, the Vite plugin, and the Vitest plugin show
consistent messages and property paths.

- Updated dependencies
[[`a71237a`](cloudflare/workers-sdk@a71237a),
[`8fade73`](cloudflare/workers-sdk@8fade73)]:
  - [email protected]

</details>

<details>
<summary><b>4.137.0</b></summary>

### Minor Changes

- [#15778](cloudflare/workers-sdk#15778)
[`cd7508c`](cloudflare/workers-sdk@cd7508c)
Thanks [@<!---->jamesopstad](https://github.com/jamesopstad)! - Generate
types during development and supported builds with Vite's
`experimental.newConfig` option or Wrangler's
`--experimental-new-config` flag (and `--experimental-cf-build-output`
for builds)

When Wrangler's `--experimental-new-config` flag or Vite's
`experimental.newConfig` option is enabled, inferred configuration and
runtime declarations are now kept in `.cloudflare/types/index.d.ts`.
Vite refreshes them during development and production builds. Wrangler
refreshes them during development and when building with both
`--experimental-new-config` and `--experimental-cf-build-output`. In the
experimental `wrangler.config.ts` format, the `types` option is now
top-level because it applies to both commands.

### Patch Changes

- [#15765](cloudflare/workers-sdk#15765)
[`1bdb96d`](cloudflare/workers-sdk@1bdb96d)
Thanks [@<!---->th0m](https://github.com/th0m)! - Prepare the required
egress sidecar for local Containers without configured images

Wrangler dev and Vite dev/preview now pull the required sidecar for
Durable Object-managed Containers that select their application image at
start time. Previously, these Containers failed to start unless the
sidecar image was already cached in Docker.

- [#15712](cloudflare/workers-sdk#15712)
[`f5605f5`](cloudflare/workers-sdk@f5605f5)
Thanks [@<!---->alsuren](https://github.com/alsuren)! - Match D1 SQL
statement splitting to the local SQLite runtime

Wrangler now uses SQLite's statement-completion state machine when
splitting D1 SQL files. This keeps trigger, quoted identifier, comment,
and keyword handling consistent with local exe

…[full
notes](https://github.com/cloudflare/workers-sdk/releases/tag/wrangler%404.137.0)

</details>

<p><i>…and 1 more release(s) not shown</i></p>

</details>

---
*This PR was auto-generated by
[catalog-update-action](https://github.com/brandhaug/catalog-update-action).*

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
brandhaug added a commit to brandhaug/b2b-saas-starter that referenced this pull request Sep 27, 2026
…lpha (#508)

## pnpm-workspace.yaml (default)

## Dependency Updates

| Package | From | To | Type |
| --- | --- | --- | --- |
| `miniflare` | 5.20260921.0-alpha | 5.20260921.1-alpha | prerelease |

## Release Notes

<details>
<summary><b>miniflare</b> (5.20260921.0-alpha →
5.20260921.1-alpha)</summary>

### Minor Changes

- [#15567](cloudflare/workers-sdk#15567)
[`a71237a`](cloudflare/workers-sdk@a71237a)
Thanks [@<!---->tpmmorris](https://github.com/tpmmorris)! - Add
row-level email resend tools to the Local Explorer

Routing captures can now be resent directly or loaded into the test
email composer for editing. Routing rows expose and use a UUID-based
capture ID for identity, detail lookup, and resend operations instead of
relying on the email's Message-ID. Message-ID detail lookup remains
available for compatibility, and resends preserve partial-capture
warnings across replayed messages.

### Patch Changes

- [#15806](cloudflare/workers-sdk#15806)
[`8fade73`](cloudflare/workers-sdk@8fade73)
Thanks [@<!---->NuroDev](https://github.com/NuroDev)! - Standardize Zod
validation error output

Format validation errors with Zod's built-in `prettifyError()` helper so
Miniflare, Wrangler, the Vite plugin, and the Vitest plugin show
consistent messages and property paths.

</details>

---
*This PR was auto-generated by
[catalog-update-action](https://github.com/brandhaug/catalog-update-action).*

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
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