-
I have a React app, and I want to catch 'vite:preloadError' after redeploy my app. Actually, I don't know where to put this listener in my code. I tried to put it in App.js or the index.html file in the head tag, but nothing happened. Can I get some hints on how I can use it?
React version is ^18.2.0. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Possible typo in the docs. window.addEventListener('vite:preloadError', (event) => {
// window.reload()
window.location.reload()
}) |
Beta Was this translation helpful? Give feedback.
-
@danielroe Can you help me about this problem? |
Beta Was this translation helpful? Give feedback.
Hi, I put it at the top of my index.jsx file, right after all imports and before the main component.