Skip to content

Commit c66150a

Browse files
committed
fix(preloader): fix vite dynamic module loading error
1 parent 9c00a0a commit c66150a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/index.tsx

+5
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,8 @@ const domNode = document.getElementById('root');
1616
if (domNode) {
1717
createRoot(domNode).render(<Main />);
1818
}
19+
20+
// https://vite.dev/guide/build#load-error-handling
21+
window.addEventListener('vite:preloadError', () => {
22+
window.location.reload();
23+
});

0 commit comments

Comments
 (0)