Static GitHub Issues

[3003] 'Redirecting to external page.' on error

prev: Error when run : npm run generate
next: Redirect absolute url in middleware

Steps to reproduce: 1. Goto non-existing page 2. 'Redirecting to external page.' is displayed for a few seconds. 3. Then error.vue is displayed.

How can we skip displaying 'Redirecting to external page.'?

I noticed this can be accomplished by swapping the following snippet in .nuxt/components/nuxt.js

// swap these two conditionals
 if (this.nuxt._redirected) {
      return h('div', [ 'Redirecting to external page.' ])
    }
    // If there is some error
    if (this.nuxt.err) {
      return h('nuxt-error', {
        props: {
          error: this.nuxt.err
        }
      })
    }
<!--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/c2602">#c2602</a>)</em></sub></div>