fix: move dynamic import module fix to handler

This commit is contained in:
Ben Furber
2024-07-31 13:14:40 +01:00
committed by benfurber
parent 5c64b38e6b
commit af3f0a5099
2 changed files with 6 additions and 6 deletions

View File

@@ -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 (
<rootStoreContext.Provider value={rootStore}>
<ThemeProvider theme={rootStore.stores.themeStore.currentTheme.styles}>

View File

@@ -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)
}