您当前的位置: 首页 >  微信小程序

【03】

暂无认证

  • 4浏览

    0关注

    196博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

微信小程序后台报错源码sourcemap定位

【03】 发布时间:2021-02-06 15:39:35 ,浏览量:4

发现错误

错误内容

undefined is not an object (evaluating \'i.length\')
https://usr//sub-packages/reimburse/app-service.js:4524:2767
https://lib/WASubContext.js:2:66482
https://lib/WASubContext.js:2:66590
e@https://lib/WASubContext.js:2:69042
https://lib/WASubContext.js:2:33161
r@https://lib/WASubContext.js:2:32864
h@https://lib/WASubContext.js:2:112402
https://lib/WASubContext.js:2:113223
https://lib/WASubContext.js:2:95115
https://lib/WASubContext.js:2:101656

这种错误没有指定报错文件来源,我们可以通过以下方法来寻找问题

1、下载线上版本 Source Map 文件

Ta长这样

展开后

2、安装sourcemap-lookup插件

执行安装命令

npm install sourcemap-lookup -g
3、寻找错误

然后我们回顾一下错误的关键位置

https://usr//sub-packages/reimburse/app-service.js:4524:2767

关键位置 sub-packages/reimburse,进入文件夹

在此文件夹执行查找命令

sourcemap-lookup app-service.js:4524:2767

sourcemap-lookup 拼接这一段位置信息

得到发生错误位置

可以看出本次报错是代码 fee_info为undefined的情况下取值了fee_info.length,undefined.length肯定报错,与小程序后台报错undefined is not an object (evaluating \'i.length\')也是相匹配的

微信开发者工具下载的 sourcemaps 怎么用【官方解释,可以了解下】

https://developers.weixin.qq.com/community/develop/article/doc/0008643aa54ce81d519ad84735b413

关注
打赏
1657344724
查看更多评论
立即登录/注册

微信扫码登录

0.0852s