nextra icon indicating copy to clipboard operation
nextra copied to clipboard

closes #4850: fix non informative error output for bad meta field when using `z.prettifyError` on parsed `z.union` schema

Open vladavoX opened this issue 2 weeks ago • 3 comments

Why:

Closes: #4850

What's being changed (if available, include any code snippets, screenshots, or gifs):

I've made the same safeParse checks, just for each type, one by one, thus the prettify can do its thing since parse response is not from union. This is how it looks with fix.

image

z.prettifyError doesn't work well with unions, because it is reporting ton of issues for each union it checks, here is a simple example, where it just pulls out the message: Invalid input at the end (same issue as here):

image

Check off the following:

  • [ ] I have reviewed my changes in staging, available via the View deployment link in this PR's timeline (this link will be available after opening the PR).

vladavoX avatar Dec 09 '25 20:12 vladavoX

🦋 Changeset detected

Latest commit: 4ccd1ef72534a6bf16b20288088d819b19d64be4

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

This PR includes changesets to release 3 packages
Name Type
nextra Patch
nextra-theme-blog Patch
nextra-theme-docs 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

changeset-bot[bot] avatar Dec 09 '25 20:12 changeset-bot[bot]

@vladavoX is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Dec 09 '25 20:12 vercel[bot]

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
nextra-v2 Ready Ready Preview Comment Dec 9, 2025 8:34pm

vercel[bot] avatar Dec 09 '25 20:12 vercel[bot]