From: Daniel Karbach Date: Thu, 31 Jul 2025 11:43:34 +0000 (+0200) Subject: reload page on chunk load fail X-Git-Url: http://git.localhorst.tv/?a=commitdiff_plain;h=57d5717fc51c818d3b58c40c978912fecda61238;p=alttp.git reload page on chunk load fail --- 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