From e9dd3340bf01eeef0af6a2a64cf6e1874886bb30 Mon Sep 17 00:00:00 2001 From: = Date: Wed, 26 Feb 2025 14:33:31 +0530 Subject: [PATCH] feat: added vite error handler to resolve post build error --- frontend/src/main.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/src/main.tsx b/frontend/src/main.tsx index 37dcd4ccd..e2114636e 100644 --- a/frontend/src/main.tsx +++ b/frontend/src/main.tsx @@ -19,7 +19,12 @@ import "./index.css"; import "./translation"; // don't want to use this? // have a look at the Quick start guide -// for passing in lng and translations on init +// for passing in lng and translations on init/ + +// https://vite.dev/guide/build#load-error-handling +window.addEventListener("vite:preloadError", () => { + window.location.reload(); // for example, refresh the page +}); // Create a new router instance NProgress.configure({ showSpinner: false });