TRex
Error Boundary (for both csr & ssr)
Since the <NuxtClientFallback> does not work at all and the <NuxtErrorBoundary> is only for client-side, I ve created this custom component.
Im currently using this component to handle both client and server side errors to avoid my whole page is being redirected to error.vue instead I want to handle the component that throwing error manually and be able to render the rest of the page.
This component (below) is catching most of the errors but when it comes to TypeError, nuxt redirects to error.vue (which Im trying to avoid).
I think the problem is nuxt redirects to error.vue just before I could set the error (ref).
I've tried this approach with useState too.
I've tried to use nuxt hook (app:error) . it is also didnt work.
Nuxt version: 3.11.x
1 replies
Component-Based Error Handling (SSR)?
<NuxtErrorBoundry> component handles client-side errors happening in its default slot. But its not works on ssr. We are getting the ugly error page if the page that contains error is rendered on SSR. I want to my whole page to be rendered except the component that throws an err. Is there any way to handle this?
3 replies