fix(Vite/PWA): on vite preload error, reload

This commit is contained in:
ShareVB committed 2025-11-08 09:26:56 +01:00
1 parent 935600c969
commit a18259595e
1 file changed
+6
+6
View File
@@ -21,6 +21,12 @@ import { i18nPlugin } from './plugins/i18n.plugin';
import store from './tools/pomodoro-timer/app/store';
window.addEventListener('vite:preloadError', (event: Event) => {
console.error('Vite preload error, forcing page reload:', event);
event.preventDefault(); // Prevent the original error from being thrown again
window.location.reload();
});
// eslint-disable-next-line no-extend-native
BigInt.prototype.toJSON = function () {
return JSON.rawJSON ? JSON.rawJSON(this.toString()) : this.toString();