Hi, that's right it not on the documentation yet but will comes soon but it's possible.
You need to create a /pages/_error.vue file.
There is an example here on how we use it on nuxtjs.org.
Which probably refer's to this now: https://github.com/nuxt/nuxtjs.org/blob/3d1d3d02616283b3001e638b44c8b99a2ad4a23f/layouts/error.vue
Is it possible to somehow change the value of title meta tag on error page?
I'm using nuxt 1.1.1 and the following snippet does not work for me in error.vue. It works in other pages however.
head () {
return {
title: 'Error 404'
};
}
@jamesAtcodeninja probably no such hook in the error case, since it's a minimal setup.
(What if whatever caused the error runs when trying to render a page displaying the error)
error.vue is only work on 1 level route, ex: /foo.
In multiple level route, the default page will display instead of the error.vue, ex: /foo/bar.
If I use function error({ statusCode: 404, message: 'Page not found' }), error.vue is not working too.
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
error.vueis only work on 1 level route, ex:/foo.In multiple level route, the default page will display instead of the
error.vue, ex:/foo/bar.If I use function
error({ statusCode: 404, message: 'Page not found' }),error.vueis not working too.