Custom Error Page not rendered when trowing an error using createError inside Promise. #517
marcoborsoi
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
I want to display a custom 404 page when a GraphQL query does not return the requested data. I have created the error.vue in root following the docs here: https://nuxt.com/docs/getting-started/error-handling#rendering-an-error-page
I'm asking the same question at the Nuxt Core main repo as well.
The issue I'm facing is that
createError
throws a[nitro] [dev] [uncaughtException] H3Error
and the custom error page (error.vue) is not displayed.In my particular case, the issue only happens when I use
createError
insideonResult
.Here's the reproduction using Nuxt Apollo: https://stackblitz.com/edit/nuxt-apollo-demo-cd35uc?file=app.vue
The same issue happens when trowing an error using
createError
inside aPromise
:createError
throws a[nitro] [dev] [uncaughtException] H3Error
and the custom error page (error.vue) is not displayed.Here's the reproduction using Promises: https://stackblitz.com/edit/nuxt-starter-w4jdc1?file=app.vue
Thank you
Beta Was this translation helpful? Give feedback.
All reactions