How to solve the problem of getting static js failure in vue project. Loading chunk XX failed

clipboard.png

the error is shown in the figure, but it is normal after refresh.

has referred to the answer https://codeshelper.com/q/10., modified nginx, but has no effect.
it is speculated that it has something to do with caching, and the error occurs only when the user stays on the page too long.

Can

provide a better solution?

Jun.16,2021

https://codeshelper.com/a/11.


window.onerror catch and analyze errors. If it is loading chunk fail , the page pop-up window prompts you to refresh

.
Menu