Nuxt.js: How to customized nuxt-error.vue

Created on 25 Jan 2018  路  8Comments  路  Source: nuxt/nuxt.js

Server error page render node_modules\nuxt\lib\app\components\nuxt-error.vue

node_modules\nuxt\lib\app\components\nuxt.js:3

import NuxtError from '<%= components.ErrorPage ? 
((components.ErrorPage.indexOf('~') === 0 || components.ErrorPage.indexOf('@') === 0)
 ?
 components.ErrorPage : "../" + components.ErrorPage) : "./nuxt-error.vue" %>'

i use

```js
components:{
ErrorPage:'~/components/ErrorPage'
}
````

in nuxt.config.js

but it is still render nuxt-error.vue not my ErrorPage

This question is available on Nuxt.js community (#c2333)
help-wanted

Most helpful comment

@clarkdo

// nuxt.config.js
module.exports = {
  ErrorPage:'~/components/ErrorPage'
}

this config will cover layout/error.vue ,like 404 error, and nuxt-error.vue still render on server error.

i want customized only node server error,like this

All 8 comments

Just ErrorPage, no components is fine.

// nuxt.config.js
module.exports = {
  ErrorPage:'~/components/ErrorPage'
}

@clarkdo

// nuxt.config.js
module.exports = {
  ErrorPage:'~/components/ErrorPage'
}

this config will cover layout/error.vue ,like 404 error, and nuxt-error.vue still render on server error.

i want customized only node server error,like this

@ac88 did you find a solution for this?

@SalvadorDuran I haven't done yet

I'll look into it today, I'm interested too! :)

Customize "client-side" error template:

  1. Add a layouts/error.vue file
  2. Customize it

Customize "server-side" error template:

(See https://blog.lichter.io/posts/change-the-nuxtjs-server-error-page/ )

  1. Add an error.html file under: app/views/
  2. Customize it :relaxed:

This question has been resolved by @manniL, see answer.

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vadimsg picture vadimsg  路  3Comments

bimohxh picture bimohxh  路  3Comments

danieloprado picture danieloprado  路  3Comments

pehbehbeh picture pehbehbeh  路  3Comments

shyamchandranmec picture shyamchandranmec  路  3Comments