react-hook-form / resolvers

📋 Validation resolvers: Yup, Zod, Superstruct, Joi, Vest, Class Validator, io-ts, Nope, computed-types, typanion, Ajv, TypeBox, ArkType, Valibot, effect-ts and VineJS
https://react-hook-form.com/
MIT License
1.71k stars 155 forks source link

Weird type error on zodResolver #612

Closed tcolinpa closed 1 year ago

tcolinpa commented 1 year ago

Describe the bug Type error on zodResolver(), unable to trace error.

To Reproduce

Codesandbox link (Required) Codesandbox

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem. image image

Additional context react: 18.2.0 react-dom: 18.2.0 zod: 3.19.1 react-hook-form: ^7.12.2 @hookform/resolvers: ^3.2.0

tcolinpa commented 1 year ago

This was caused due to mismatched versions of zod in a pnpm monorepo

image

Updated all to 3.21.4 and it fixed.

Cheers to #540