Hi guys!
Looks like it's really simple, but I don't find any info in the docs.
I have middleware for handling errors that can be in nuxtServerInit:
export default ({store, error}) => {
if (store.state.serverError) {
error(store.state.serverError)
}
}
What I expect
I thought that if I call error in middleware than Nuxt stop render matched layouts/pages and show Error page (I use simple custom layouts/error.vue template)
What I got
When I call error in middleware Nuxt show Error page, then continue to call asyncData of the matched page in the background. As result, I see the error page, but API server receives unnecessary calls.
How can I tell Nuxt to stop calling asyncData after calling error in the middleware?
Hi @KonstantinVlasov,
Have you tried with:
export default ({store, error}) => {
if (store.state.serverError) {
return error(store.state.serverError)
}
}
Hi! Yes sure, same result.
Same problem, anything new about it?
The same
Will be fixed in next release, sorry about this.
Awesome, thanks!
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
Hi! Yes sure, same result.