mirror of
https://github.com/sharevb/it-tools.git
synced 2026-11-20 21:23:08 +03:00
fix(Vite/PWA): on vite preload error, reload
This commit is contained in:
1 parent
935600c969
commit
a18259595e
1 file changed
+6
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user