From 57d5717fc51c818d3b58c40c978912fecda61238 Mon Sep 17 00:00:00 2001 From: Daniel Karbach Date: Thu, 31 Jul 2025 13:43:34 +0200 Subject: [PATCH] reload page on chunk load fail --- resources/js/bootstrap.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/resources/js/bootstrap.js b/resources/js/bootstrap.js index 0ed0904..21f2589 100644 --- a/resources/js/bootstrap.js +++ b/resources/js/bootstrap.js @@ -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 -- 2.47.2