'How do I implement custom error pages in NuxtJS 3?
I'm trying to get my NuxtJS 3 app to show custom error pages. The app is universal with SSR. The NuxtJS 2 docs say to add a layouts/error.vue
file and it should get picked up. However, while using NuxtJS 3, my custom page is never shown - either through a hard reload or navigating to a broken link with a <NuxtLink>
via the router.
Have custom error pages in NuxtJS 3 changed? There doesn't seem to be any documentation on them in the docs https://v3.nuxtjs.org/docs/directory-structure/layouts
Solution 1:[1]
If you add the error page in the root and not in the layouts folder, it works!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Kim |