Static GitHub Issues

[2188] Incorrect documentation or bug with errors.vue?

prev: `npm run generate` have a error 'socket hang up '
next: router base error in Nuxt version rc11

This is similar to #2120

I was trying to make a 404 page that I can serve using Nginx. I was able to do that using ./pages/404.vue. But I found that the router was still serving up NuxtError when vue-router 404 errors occurred.

I found the following the docs for the errors pages but I was unable to actually get them working.

I created a layout exactly as it described but still, nothing happened. My original 404 would work fine (404.html from ./pages/404.vue) if I went to something like missing.html but would redirect to the default NuxtError component for all other router 404s.

I then read the source and found that there is an undocumented option called ErrorPage that is available in nuxt.config.js. This property points to a component to use when there is an error or it will fall back to ./components/nuxt-error.vue.

I added an entry to my config for ErrorPage and pointed it to a new component I made at ./components/ErrorPage.vue. After that, everything worked perfectly.

So I guess my concern is that either the docs are wrong, or there is a bug in nuxt that doesn't serve the ./layouts/errors.vue properly.

Anyone else having this issue?

<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c1931">#c1931</a>)</em></sub></div>