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

Cannot seem to trigger a client validation error using Valibot/Zod #58

Open
agenordebriat opened this issue Dec 25, 2023 · 0 comments
Open

Comments

@agenordebriat
Copy link

Environment

  • Nuxt 3.8.2
  • vue-query-nuxt 0.3.0
  • Tried w/ latest Node/Bun versions

Reproduction

StackBlitz reproduction

What I'm currently trying to achieve is display an error page on validation error, since, as you can see, my PostsSchema is waiting for the body to be a number, purely for testing purposes of course.

It only works when I await suspense() at the end of my script setup, or if I try/catch the parse from Valibot (same thing happens with parse from Zod) and throw a showError. createError with fatal: true is also not an option for some reason I'm not getting.

I recon I must be misunderstanding some things along the way.

Describe the bug

Shouldn't my return parse(PostsSchema, response) trigger an error, then the queryFn should do something so I'm not left with a blank page and no error feedback at all?

Additional context

No response

Logs

No response

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