Skip to content

Commit

Permalink
fix: prod users seeing a dynamic import error
Browse files Browse the repository at this point in the history
  • Loading branch information
benfurber committed Jul 30, 2024
1 parent 651dbc4 commit ada9447
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ 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}>
Expand Down

0 comments on commit ada9447

Please sign in to comment.