'webviewId'没有定义?
发布于 5 年前 作者 xia21 5665 次浏览 来自 问答

Cannot read property ‘webviewId’ of undefined 这是出了什么问题?

错误代码:

jsEnginScriptError
Cannot read property ‘webviewId’ of undefined
TypeError: Cannot read property ‘webviewId’ of undefined
    at B (http://1874872866.appservice.open.weixin.qq.com/WAService.js:8:19504)
    at j (http://1874872866.appservice.open.weixin.qq.com/WAService.js:8:20131)
    at .<anonymous> (http://1874872866.appservice.open.weixin.qq.com/WAService.js:8:22039)
    at http://1874872866.appservice.open.weixin.qq.com/WAService.js:8:26882
    at http://1874872866.appservice.open.weixin.qq.com/WAService.js:4:9686
    at Array.forEach (native)
    at .<anonymous> (http://1874872866.appservice.open.weixin.qq.com/WAService.js:4:9666)
    at http://1874872866.appservice.open.weixin.qq.com/WAService.js:4:21083
    at n.<anonymous> (http://1874872866.appservice.open.weixin.qq.com/asdebug.js:1:12545)
    at n.emit (http://1874872866.appservice.open.weixin.qq.com/asdebug.js:1:8747)

9 回复

我也出现过,是在待机一会后打开出现的,页面销毁重新进入就可以,也不知道什么问题

现在找到问题所在了,是在app.js中做是否登录的判定,把这个换在每一页进行登录判定就好了

@晨 了解了,看来只能加一个启动页了

是在app.js中的onlaunch事件,不能引导跳转页面,因为onlaunch的时候页面栈中没有页面才导致这个问题

你好,是否调用了switchTab?是在哪里调用的呢

如果需要动态定义首页,比如在app启动后根据用户的信息跳转到不同的首页,就会在onLaunch中调用switchTab,就会报这个错,希望官方能够解决,实际中确实会有这样的需求啊

onLaunch的时候页面栈还不存在,没有办法跳转页面。按照现在的实现,只能通过在首页进行跳转,或者将首页实现为singlepage。

我使用swtichTab跳转,也会出现这个问题,请问如何解决呢

有时候出现这个问题,有时候就好了……是不是ide有bug啊

回到顶部