404 does not load error.vue
I'm using dynamic routes and when trying to access a non-existing page the app throws a 404. This however does not trigger loading
error.vue
placed in the root folder, instead the normal layout is rendered (without content). Am I missing something obvious here? This used to work flawlessly in Nuxt 2 (with error.vue in the template folder) but in Nuxt 3 I cannot find a way to display the error page.8 Replies
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
I just tried to trigger a 404 with
throw createError({ statusCode: 404, statusMessage: 'Page Not Found' });
in [...slug].vue
and the error page does not load. This seems to be an issue with Netlify, it's working locally.Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Is it working in production or locally? For me locally all good but Netlify refuses to load error.vue
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
createError({statusCode:404, fatal: true})
to be sure to have the redirection
Thank you @xibman that did the trick!
you're welcome !