/* Routing exception error handling, an error occurred while trying to resolve an asynchronous component, re-render the target page */

The configuration in vue.config.js is as follows:


router.onError((error) => { const pattern = /Loading chunk (\d)+ failed/g; const isChunkLoadFailed = error.message.match(pattern); const targetPath = router.history.pending.fullPath; if (isChunkLoadFailed) { router.replace(targetPath); }})