mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 16:43:55 +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()
|
||||
} catch (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)
|
||||
this.error({ statusCode, message: err.message })
|
||||
this.$nuxt.$emit('routeChanged', to, from, err)
|
||||
|
Loading…
Reference in New Issue
Block a user