diff --git a/src/App.tsx b/src/App.tsx index 1d7178b86..f415b4782 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -12,12 +12,6 @@ import { Pages } from './pages' export const App = observer(() => { const rootStore = useCommonStores() - // To handle when hosting deletes the assets from previous deployments - // https://vitejs.dev/guide/build#load-error-handling - window.addEventListener('vite:preloadError', () => { - window.location.reload() - }) - return ( diff --git a/src/common/Error/handler.ts b/src/common/Error/handler.ts index b2d47a1e0..e48d1ab78 100644 --- a/src/common/Error/handler.ts +++ b/src/common/Error/handler.ts @@ -13,6 +13,12 @@ export const initErrorHandler = () => { return } + // To handle when hosting deletes the assets from previous deployments + // https://vitejs.dev/guide/build#load-error-handling + window.addEventListener('vite:preloadError', () => { + window.location.reload() + }) + // please check https://docs.sentry.io/error-reporting/configuration/?platform=javascript for options Sentry.init(SENTRY_CONFIG) }