-
-
Notifications
You must be signed in to change notification settings - Fork 218
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
Type of ValiError.issues #693
Comments
This information can be found under the
Something is wrong here, but everything looks fine on my machine. What version of Valibot are you using? Can you share your schema and the shown code with me?
You can also pass the issue to |
This is because not every path item has a |
v0.36.0 is available |
So trick is, use: } catch (error) {
if (v.isValiError(error)) { not } catch (error) {
if (error instanceof v.ValiError) { |
Yes, but even better is: |
If I do:
it will print something like this:
Nowhere in that thrown error does it say what key in the parsed object that was causing the
Expected boolean but received undefined
.I can sort of figure that out by doing this instead:
Now, I can see, before the error throws that apparently it's in
.post.hide_comments
. Ah! That's what I wanted/needed to know.In fact, it prints:
By why is the
error.issues[0].path
of typeany[]
?Now I get a TS error on this:
Perhaps I'm missing something obvious but figuring out which key in my object schema the error was about was very hard.
The text was updated successfully, but these errors were encountered: