-
-
Notifications
You must be signed in to change notification settings - Fork 169
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
Yup resolver silently ignores error that are not ValidationError #320
Comments
We don't validate your schema. This should be taken care of at your schema level check, resolver only focuses on |
I meant yup's schema validator, not @hookform/resolvers. Sorry if it was confusing. |
In your case, Yup fails but the thrown error does not contain the path of the field. So we can't attach the error to a react-hook-form field. Do you see what I mean? |
Yes I understand. |
Maybe that's something we can consider. What's your thoughts @jorisre? |
Yep, sounds good to me. I'll open a PR. Thanks for the issue. |
Fixed in the last version |
Describe the bug
For example, when a TypeError (
TypeError: You cannot `concat()` schema's of different types: string and number
) is thrown by the schema validator (validator of the schema itself), the yup resolver silently ignores the error because theerror.field
described in this line of code is missing, falling back to a blank array.To Reproduce
Steps to reproduce the behavior:
Codesandbox link (Required)
Include a codesandbox will help us to investigate the issue quicker.
My fork of yup resolver template
Expected behavior
Error
TypeError: You cannot `concat()` schemes of different types: string and number
thrown.Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: