Nuxt.js: Error page does not work in production mode

Created on 14 Jan 2020  路  3Comments  路  Source: nuxt/nuxt.js

Version

v2.11.0

Reproduction link

https://github.com/lhsazevedo/nuxt-missing-error-page-demo

Steps to reproduce

  • Clone reproduction repository, install dependencies
  • npm run build
  • npm run start
  • Click on "Throw error" button

What is expected ?

The exception should be caught by the Nuxt main error handler which displays a nice error page, as it happens when running in dev mode (npm run dev).

What is actually happening?

Main error handler is ignored and exception ends up logged to console.

bug-report

All 3 comments

you can have the error page back with debug:true, in nuxt.config.js. but you wouldn't want to do that in production.

I would suggest you catch the error, then call this.$nuxt.error({ message: "Boom" })

Hello @lhsazevedo !

Same problem for me, did you manage to get around this problem ?

@talebi1 Now I see that this is a debug handler for developers (even mentions dev tools console), thank you.

@antoineabbou Yeah, I've created an Error Boundary component that wraps my default Layout content. It renders the default slot until an error is captured, and then switches to a simple 'Oops' page (simple v-if/v-else). Gist demo here.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nassimbenkirane picture nassimbenkirane  路  3Comments

maicong picture maicong  路  3Comments

bimohxh picture bimohxh  路  3Comments

mikekidder picture mikekidder  路  3Comments

surmon-china picture surmon-china  路  3Comments