Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weird type error on zodResolver #612

Closed
tcolinpa opened this issue Aug 9, 2023 · 1 comment
Closed

Weird type error on zodResolver #612

tcolinpa opened this issue Aug 9, 2023 · 1 comment

Comments

@tcolinpa
Copy link

tcolinpa commented Aug 9, 2023

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

To Reproduce

  • Create any schema with zod
  • Create a form with useForm<z.infer>({resolver: zodResolver(schema)})

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
Copy link
Author

tcolinpa commented Aug 9, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant