vue子路由push失敗 ChunkLoadError: Loading chunk 5 failed和警告uncaught error during route navigationey

我在某個子路由內使用了一個this.$router.push,並且確保這個地址被註冊了,但是卻無法跳轉。

                this.$router.push({path:'/1'}).catch(error => {
                    if (error.name !== "NavigationDuplicated") {
                        throw error;
                    }
                });

錯誤是我從沒見過的: ChunkLoadError: Loading chunk 5 failed。後來發現問題是我路由模式設置成了history,但是後端卻沒有進行相應的設置,註釋掉即可。
在這裏插入圖片描述
參考鏈接:https://juejin.im/post/5ceedf8ff265da1b80202841
(寫的是history的後端配置)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章