-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Description
What happened?
When using z.preprocess(..., z.string()) in a Zod schema, the result is a ZodEffects<ZodString, string, unknown>. This is expected and correct behavior from Zod.
However, when this schema is passed into toTypedSchema() from @vee-validate/zod and used with useForm(), the field's value is incorrectly inferred as unknown, rather than the actual inner type (string in this case).
This breaks downstream usage with defineField()which then expose Ref instead of Ref, despite the Zod schema clearly specifying a string via transformation.
Reproduction steps
...
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
Demo link
Code of Conduct
- I agree to follow this project's Code of Conduct
Metadata
Metadata
Assignees
Labels
No labels