mirror of
https://github.com/sharevb/it-tools.git
synced 2026-11-25 15:15:23 +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';
|
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
|
// eslint-disable-next-line no-extend-native
|
||||||
BigInt.prototype.toJSON = function () {
|
BigInt.prototype.toJSON = function () {
|
||||||
return JSON.rawJSON ? JSON.rawJSON(this.toString()) : this.toString();
|
return JSON.rawJSON ? JSON.rawJSON(this.toString()) : this.toString();
|
||||||
|
|||||||
Reference in new issue
Block a user