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

发现错误

错误内容

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

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值