mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-30 09:27:13 +00:00
reload in case of missing chunk ( e.g. site updated)
This commit is contained in:
parent
7a68e1dde1
commit
0eb928eba9
@ -140,6 +140,9 @@ async function loadAsyncComponents (to, from, next) {
|
|||||||
next()
|
next()
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
err = err || {}
|
err = err || {}
|
||||||
|
if (/^Loading chunk (\d)+ failed\./.test(err.message) && process.client) {
|
||||||
|
window.location.replace(location.href)
|
||||||
|
}
|
||||||
const statusCode = (err.statusCode || err.status || (err.response && err.response.status) || 500)
|
const statusCode = (err.statusCode || err.status || (err.response && err.response.status) || 500)
|
||||||
this.error({ statusCode, message: err.message })
|
this.error({ statusCode, message: err.message })
|
||||||
this.$nuxt.$emit('routeChanged', to, from, err)
|
this.$nuxt.$emit('routeChanged', to, from, err)
|
||||||
|
Loading…
Reference in New Issue
Block a user