fix(vue-app): catch error on full static for store mutations

[release]
This commit is contained in:
Sébastien Chopin 2020-05-17 00:04:06 +02:00
parent 7cf4edba60
commit f4f6b1912b

View File

@ -511,10 +511,10 @@ async function render (to, from, next) {
<% } %> <% } %>
<% if (isFullStatic && store) { %> <% if (isFullStatic && store) { %>
// Replay store mutations // Replay store mutations, catching to avoid error page on SPA fallback
promises.push(this.fetchPayload(to.path).then(payload => { promises.push(this.fetchPayload(to.path).then(payload => {
payload.mutations.forEach(m => { this.$store.commit(m[0], m[1]) }) payload.mutations.forEach(m => { this.$store.commit(m[0], m[1]) })
})) }).catch(err => null))
<% } %> <% } %>
// Check disabled page loading // Check disabled page loading