]> git.localhorst.tv Git - alttp.git/commitdiff
reload page on chunk load fail
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Thu, 31 Jul 2025 11:43:34 +0000 (13:43 +0200)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Thu, 31 Jul 2025 11:43:34 +0000 (13:43 +0200)
resources/js/bootstrap.js

index 0ed0904e17edb549e1d3c6e3f018b0628b526f3a..21f25892e2cefcb6ab790cdd7e1b021caaa79f52 100644 (file)
@@ -13,6 +13,11 @@ window.axios = axios;
 window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
 window.axios.defaults.paramsSerializer = p => qs.stringify(p, { arrayFormat: 'brackets' });
 
+// refresh page on chunk failure
+window.addEventListener('vite:preloadError', () => {
+       window.location.reload();
+});
+
 /**
  * Echo exposes an expressive API for subscribing to channels and listening
  * for events that are broadcast by Laravel. Echo and event broadcasting