This error occurs because a page appears in your Vue router global navigation guard, jumps to a page and then redirects to another interface
router.beforeEach((to,from,next)=>{
if(to.matched.some(record => record.meta.requiresAuth)){
if(!store.state.user){
//Jump to the landing page
next({
name:'login',
query:{//Pass the query string parameter via url
redirect: to.fullPath//Tell the landing page the page that needs to be returned if the login is successful
}
})
}else{
next()
}
}else{
next()
}
next()
})
If such code appears in Vue router, this error will occur. The solution is not to use multi-layer if and else
Read More:
- Vue Error: Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation to current location
- VueUncaught (in promise) NavigationDuplicated: Avoided redundant navigation to current location: “/
- [Solved] Vue console error: navigationduplicated: avoided redundant navigation to current location
- [Solved] Uncaught (in promise) Error: Avoided redundant navigation to current location:
- Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation to crrent location: “/home“
- [Solved] Vue Error: Avoided redundant navigation to current location:/xxxx
- Vue elementui: solution for error: avoided redundant navigation to current location: “/xxx”
- Vue: How to Solve error avoided redundant navigation to current location: “/xxx”
- Vue solves the problem of repeated click navigation route error
- How to open a page in a new window by Vue router
- [Solved] Router Pinia error: getActivePinia was called with no active Pinia. Did you forget to install pinia
- [Solved] Vue-cli Error: Module not found: Error: Can‘t resolve ‘vue-router ‘
- [Solved] react-router-dom Error: <NavLink>activeClassName
- Vue-router import Dynamic Module Error [How to Solve]
- [Solved] react-router-dom Error: index.js:1 Warning: Functions are not valid as a React child.
- Ts-node Error: return new TSError(diagnosticText, diagnosticCodes);
- [Solved] ESlint Create New File Error: Component name “Home” should always be multi-word.
- After installing NPM, NRM LS reports an error throw new err_INVALID_ARG_TYPE(name, ‘string‘, value)
- [Solved] vue-roter 4 Error: Error: Invalid route component/Uncaught (in promise) Error: Invalid route component
- How to React page to achieve entry and exit animation