Skip to content

union errors aren't handled properly with Vee-Validate 4 + Zod 4 #5153

Description

@BlueskyFR

What happened?

Until Vee-Validate 5 is stable it would be nice to piece up the last remaining little bits to make VV 4 compatible with Zod 4.

Reproduction steps

ZodIssue's field unionErrors was renamed to errors in Zod 4 and it's childs do not require accessing .issues anymore.

Version

Vue.js 3.x and vee-validate 4.x

What browsers are you seeing the problem on?

  • Firefox
  • Chrome
  • Safari
  • Microsoft Edge

Relevant log output

vee-validate-zod.mjs:139 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'flatMap')
    at vee-validate-zod.mjs:139:45
    at Array.forEach (<anonymous>)
    at processIssues (vee-validate-zod.mjs:136:12)
    at Object.parse (vee-validate-zod.mjs:83:13)
    at async validateTypedSchema (vee-validate.mjs:967:30)
    at async _validateSchema (vee-validate.mjs:2859:15)
    at async vee-validate.mjs:2373:17
    at async Object.runLatest [as validateSchema] (vee-validate.mjs:518:24)
    at async validateCurrentValue (vee-validate.mjs:1646:33)
    at async runLatest (vee-validate.mjs:518:24)

Demo link

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions