closes #4850: fix non informative error output for bad meta field when using `z.prettifyError` on parsed `z.union` schema
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.
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):
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).
🦋 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
@vladavoX is attempting to deploy a commit to the Vercel Team on Vercel.
A member of the Team first needs to authorize it.
The latest updates on your projects. Learn more about Vercel for GitHub.
| Project | Deployment | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| nextra-v2 | Preview | Comment | Dec 9, 2025 8:34pm |