mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
fix: error page rendering before redirect (#3782)
* 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
This commit is contained in:
parent
820f0fae1a
commit
ef85723fe6
@ -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)
|
||||
})
|
||||
|
||||
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user