forked from weimobGroup/WeConsole
-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
起因:app.js引入weconsole之后,报错。定位之后,发现是因为relaunch的传参错误,原始代码传入了url字符串。
// app.js
onShow(options) {
wx.getStorage({
key: 'sid',
success(res) {
that.setSid(res.data.value);
that.storeBindings.updateStoreBindings();
},
fail(err) {
wx.nextTick(() => {
wx.reLaunch(HOME_PATH); // ****************报错行数,HOME_PATH='/page/home/index'
// 正确的写法 wx.reLaunch({url: HOME_PATH});
});
}
});
}
Error: MiniProgramError
{"errno":1001,"errMsg":"reLaunch:fail parameter error: parameter.url should be String instead of Undefined;"}
at Object.errorReport (WAServiceMainContext.js?t=wechat&s=1719467770338&v=3.3.3:1)
at Function.thirdErrorReport (WAServiceMainContext.js?t=wechat&s=1719467770338&v=3.3.3:1)
at Object.thirdErrorReport (WAServiceMainContext.js?t=wechat&s=1719467770338&v=3.3.3:1)
at i (WASubContext.js?t=wechat&s=1719467770338&v=3.3.3:1)
at Object.cb (WASubContext.js?t=wechat&s=1719467770338&v=3.3.3:1)
at V._privEmit (WASubContext.js?t=wechat&s=1719467770338&v=3.3.3:1)
at V.emit (WASubContext.js?t=wechat&s=1719467770338&v=3.3.3:1)
at WASubContext.js?t=wechat&s=1719467770338&v=3.3.3:1
at n (WASubContext.js?t=wechat&s=1719467770338&v=3.3.3:1)
at Le (WASubContext.js?t=wechat&s=1719467770338&v=3.3.3:1)(env: macOS,mp,1.06.2405020; lib: 3.3.3)
我的问题是,为什么我不用这个包不会引发这个错误?(同样走入了fail()函数中)。我看readme里面说有重写一些方法(console和api),猜测是这个原因。是重写了console的原因还是重写relaunch的原因?想问下,具体是重写了什么内容?影响范围是什么吗?
感谢~~
Metadata
Metadata
Assignees
Labels
No labels