Skip to content

Commit

Permalink
fix: error page rendering before redirect (#3782)
Browse files Browse the repository at this point in the history
* fix: error page rendering before redirect

* fix: cancel redirect after redirect to external link

* refactor: simplify ERR_REDIRECT

* refactor: simplify ERR_REDIRECT

* refactor: trigger routeChanged when redirect external link
  • Loading branch information
clarkdo committed Aug 22, 2018
1 parent 820f0fa commit ef85723
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/app/client.js
Expand Up @@ -71,9 +71,6 @@ Vue.config.errorHandler = (err, vm, info) => {
createApp()
.then(mountApp)
.catch((err) => {
if (err.message === 'ERR_REDIRECT') {
return // Wait for browser to redirect...
}
console.error('[nuxt] Error while initializing app', err)
})

Expand Down Expand Up @@ -392,6 +389,8 @@ async function render (to, from, next) {
} catch (error) {
if (!error) {
error = {}
} else if (error.message === 'ERR_REDIRECT') {
return this.$nuxt.$emit('routeChanged', to, from, error)
}
_lastPaths = []
const errorResponseStatus = (error.response && error.response.status)
Expand Down

0 comments on commit ef85723

Please sign in to comment.