diff --git a/lib/app/client.js b/lib/app/client.js index 371ab1978f..6dc71d63b0 100644 --- a/lib/app/client.js +++ b/lib/app/client.js @@ -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)