N
Nuxt2y ago
Henrik

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
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Henrik
HenrikOP2y ago
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
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Henrik
HenrikOP2y ago
Is it working in production or locally? For me locally all good but Netlify refuses to load error.vue
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
xibman
xibman2y ago
createError({statusCode:404, fatal: true}) to be sure to have the redirection
Henrik
HenrikOP2y ago
Thank you @xibman that did the trick!
xibman
xibman2y ago
you're welcome !
Want results from more Discord servers?
Add your server