app启动时, 如果先replace 到子页面登录, 再switchTab 到首页, 如果首页包含 usingComponents 则报错, 页面渲染终止, 安卓手机端同样报错, 此bug 可重复实现
pages/shop/shop-list/shop-list: onLoad have been invoked
WAService.js:17 pages/shop/shop-list/shop-list: onShow have been invoked
app.js? [sm]:61 webviewScriptError
Cannot read property ‘diff’ of undefined
TypeError: Cannot read property ‘diff’ of undefined
at Function.value (http://127.0.0.1:65091/__pageframe__/__dev__/WAWebview.js:18:13225)
at v (http://127.0.0.1:65091/__pageframe__/__dev__/WAWebview.js:20:10189)
at http://127.0.0.1:65091/__pageframe__/__dev__/WAWebview.js:20:10942
VM24627:1 Mon Mar 12 2018 17:44:33 GMT+0800 (中国标准时间) 渲染层错误
VM24627:2 TypeError: Cannot read property ‘diff’ of undefined
at Function.value (:65091/__pageframe__/__dev__/WAWebview.js:18)
at v (:65091/__pageframe__/__dev__/WAWebview.js:20)
at :65091/__pageframe__/__dev__/WAWebview.js:20
(anonymous) @ VM24627:2
VM24629:1 Mon Mar 12 2018 17:44:33 GMT+0800 (中国标准时间) 渲染层错误
VM24630:1 Mon Mar 12 2018 17:44:33 GMT+0800 (中国标准时间) 渲染层错误
VM24630:2 Uncaught TypeError: Cannot read property ‘diff’ of undefined
(anonymous) @ VM24630:2
请问这个问题是还没有修复吗?我现在tabbar页面pages/index/index里的一个方法中用redirectTo跳转到一个非tabbar页面,再从这个非tabbar页面中的一个方法中用switchTab跳回首页也报这个错。也是首页里使用了自定义组件。
基础库 1.9.91重现bug
-
把’pages/index/index’ 配置为tabbar 并把 index,json 配置 { “usingComponents”:{} }
-
app.js 中 配置 :onLaunch: function () {
wx.redirectTo({
url: ‘/pages/logs/logs’,
})
}
- /pages/logs/logs.js 中 使用 wx.switchTab 跳转回index;即可重现bug
onLoad(){
wx.switchTab({
url: ‘/pages/index/index’,
})
}
- 去除index,json 配置的 { “usingComponents”:{} } 则bug不出现