收藏
回答

onCheckForUpdate,版本更新回调,总数抛这个异常

框架类型 问题类型 操作系统版本 手机型号 微信版本
小程序 Bug iOS 12.0.1 iPhone 6.7.3

bug异常

thirdScriptError undefined is not an object (evaluating 'r.apply');at App onLaunch function;at onCheckForUpdate callback function https://lib/WAService.js:1:100160 https://lib/WAService.js:1:395965 forEach@[native code] Zd@https://lib/WAService.js:1:395929 https://lib/WAService.js:1:395896 emit@https://lib/WAService.js:1:205071 https://lib/WAService.js:1:395774 https://lib/WAService.js:1:168290 S@https://lib/WAService.js:1:1731 global code



代码片段

if(wx.getUpdateManager){
const updateManager = wx.getUpdateManager();
updateManager.onCheckForUpdate();
updateManager.onUpdateReady(function(err){
console.log('跟新版本准备好了', err);
updateManager.applyUpdate();
wx.showToast({
icon: 'success',
title: '新版本已经准备好'
       });
});
updateManager.onUpdateFailed(function (err) {
console.log('更新版本失败', err);
updateManager.onCheckForUpdate();
});
}


回答关注问题邀请回答
收藏

2 个回答

  • 小确幸🐾
    小确幸🐾
    2018-10-30

    出现相同问题,而且是之前没有这个问题,最近才开始报这个错的,不知道是不是官方有什么更新导致的

    2018-10-30
    有用
    回复
  • ==
    ==
    2018-10-23

    updateManager.onCheckForUpdate();

    你这个写成这样

    updateManager.onCheckForUpdate(function(res){

    });



    2018-10-23
    有用
    回复 1
    • 浪小志
      浪小志
      2021-05-20
      就是这样写的,报警群还是一样弹出错误消息
      2021-05-20
      回复
登录 后发表内容