The following error message appears


Solution:
Set the index.js under router as follows, and the problem is solved


The code is as follows.
// Repeated click on the route reports an error
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
}
const originalReplace = VueRouter.prototype.replace
VueRouter.prototype.replace = function replace (location) {
return originalReplace.call(this, location).catch(err => err)
}
Set the index.js under router as follows, and the problem is solved


The code is as follows.
// Repeated click on the route reports an error
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
}
const originalReplace = VueRouter.prototype.replace
VueRouter.prototype.replace = function replace (location) {
return originalReplace.call(this, location).catch(err => err)
}
Read More:
- Vue solves the problem of repeated click navigation route error
- Vue elementui: solution for error: avoided redundant navigation to current location: “/xxx”
- [Solved] Vue Error: Avoided redundant navigation to current location:/xxxx
- [Solved] Vue console error: navigationduplicated: avoided redundant navigation to current location
- Vue: How to Solve error avoided redundant navigation to current location: “/xxx”
- VueUncaught (in promise) 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“
- Solving routing errors by rewriting Vue push method
- Solve the problem of repeatedly clicking the same route console in Vue to report an error
- [Solved] Vue route jumps to the same page many times error: Navigationduplicated
- Jest Vue $route error [How to Modify]
- [Solved] Vue3.2 component computed Error: Write operation failed: computed value is readonly
- Vue displays 404 and 500 interfaces according to HTTP response status
- [Solved] react-router-dom Error: index.js:1 Warning: Functions are not valid as a React child.
- Vue Error: Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation to current location
- How to Solve Uncaught (in promise) Error (Two Solutions)
- [Solved] Error: this may cause an update error. (“prov”, value)
- [Solved] Vue Error: Error in v-on handler (Promise/async): “[object object]“
- [Solved] Vue uses webpack to package error: Createapp is not a function