Vue-router reported an error after being loaded lazily and packaged online.

there is no problem locally, but when you click Navigation to enter the route after the package is launched, you will report an error, and it is very slow to load at the first time, but I can still enter the route when I click again. I used vue-router lazy load.

some people say that it is to change the build.assetsPublicPath in the idnex.js of the config folder to"/", that"s what mine is, it"s useless.

the error code is as follows:
Error: Loading chunk 4 failed.
Uncaught (in promise) Error: Loading chunk 4 failed.


this error occurs, which is usually caused by a path problem. Check it. If there is no problem, and then click to load successfully, it is possible that the operator hijacked http or dns, solution to use https.

Menu