小程序报错:{“errMsg”:“navigateTo:fail can not navigateTo a tabbar page”}
错误显示
VM791:1 Error: MiniProgramError
{"errMsg":"navigateTo:fail can not navigateTo a tabbar page"}
at Object.errorReport (VM807 WAService.js:2)
at Function.thirdErrorReport (VM807 WAService.js:2)
at Object.<anonymous> (VM807 WAService.js:2)
at I (VM807 WAService.js:2)
at Object.o [as cb] (VM807 WAService.js:2)
at VM807 WAService.js:2
at Array.forEach (<anonymous>)
at e.value (VM807 WAService.js:2)
at o (VM807 WAService.js:2)
at VM807 WAService.js:2
刚开始以为是navigateTo的原因。于是把wx.navigateTo改为wx.switchTab。但发现问题还是解决不了。后面想了20多分钟。终于让我找到了错误。
错误原因:
跳转的路径错了。从当前网页跳转到当前网页本身会报这个错误。真是糊涂一时。
url: "/pages/personal/personal"