小程序正常在线上运行,没有修改,我们小程序里有错误监控,一直都正常,没有报JS相关错误。但是2号的时候突然开始报一个 Cannot read properties of undefined (reading 'replace') 的错误,每隔不到半小时我们的告警系统就会通知这个错误,我们排查了自己项目的代码没有发现相关问题(毕竟突然出现的,我们没有发布新版本,上个版本发布已经有一周多了一直没有出现过错误告警),进一步排查发现出现这个错误的时候小程序的 SDK 和没报错前不一样,SDK 变成了3.4.9的时候才开始报的这个错,所以想问下是不是小程序基础库更新了什么导致了这个错误?
下面是我们的监控报的错误信息,在小程序的各个页面都会出现这个错误的告警:
生产环境JS异常告警
15分钟内错误计数达到: 8
告警触发时间: 2024-07-05 08:59:12
访问页面: pages/tabBar/tab5/index?$taroTimestamp=1720140907770
错误信息: MiniProgramError
Cannot read properties of undefined (reading 'replace')
TypeError: Cannot read properties of undefined (reading 'replace')
at Function.<anonymous> (https://lib/WAServiceMainContext.js:1:667527)
at <setTimeout callback function>
at https://lib/WAServiceMainContext.js:1:166653
at https://lib/WAServiceMainContext.js:1:154159
at Timeout._onTimeout (<anonymous>:352:54813)
at listOnTimeout (node:internal/timers:568:17)
at process.processTimers (node:internal/timers:511:7)
应用版本: 7.0.66
平台信息: WeChat 8.0.49
操作系统: Android 11
设备品牌: Redmi
设备型号: M2103K19C
设备类型: mobile
设备CPU: MT6833
设备接口: arm64-v8a
设备内存: 3647
小程序SDK: 3.4.9
问题已复现,我们会在后续版本中进行修复。这个报错不影响现网,可以先忽略
Cannot read properties of undefined (reading \'lat\')
TypeError: Cannot read properties of undefined (reading \'lat\')
at e.getNorth (https://map.qq.com/api/gljs?v=1.exp&key=6GUBZ-WOJKX-J7H46-7WVQI-E7A66-UTB4X&callback=__map_jssdk_init:40:105994)
at e.getNorthWest (https://map.qq.com/api/gljs?v=1.exp&key=6GUBZ-WOJKX-J7H46-7WVQI-E7A66-UTB4X&callback=__map_jssdk_init:40:105711)
at i.fitBounds (https://map.qq.com/api/gljs?v=1.exp&key=6GUBZ-WOJKX-J7H46-7WVQI-E7A66-UTB4X&callback=__map_jssdk_init:69:431333)
还有这个问题
TypeError: Cannot read properties of undefined (reading \'faceTo\')
at https://map.qq.com/api/gljs?v=1.exp&key=6GUBZ-WOJKX-J7H46-7WVQI-E7A66-UTB4X&callback=__map_jssdk_init:69:464021
at e.<anonymous> (https://map.qq.com/api/gljs?v=1.exp&key=6GUBZ-WOJKX-J7H46-7WVQI-E7A66-UTB4X&callback=__map_jssdk_init:69:463386)
at e.<anonymous> (https://map.qq.com/api/gljs?v=1.exp&key=6GUBZ-WOJKX-J7H46-7WVQI-E7A66-UTB4X&callback=__map_jssdk_init:69:143466)
at e (https://map.qq.com/api/gljs?v=1.exp&key=6GUBZ-WOJKX-J7H46-7WVQI-E7A66-UTB4X&callback=__map_jssdk_init:69:826918)
TypeError: gO.get(...) is not a function
at Function.<anonymous> (https://lib/WAServiceMainContext.js:1:972962)
还有这个,都是3.4.9
是的,我们的项目也遇到了,等官方提供原因和解决方案
MiniProgramError
Cannot read properties of undefined (reading 'replace')
TypeError: Cannot read properties of undefined (reading 'replace')
at Function.<anonymous> (https://lib/WAServiceMainContext.js:1:667527)
at <setTimeout callback function>
at https://lib/WAServiceMainContext.js:1:166653
at https://lib/WAServiceMainContext.js:1:154159
at Timeout._onTimeout (<anonymous>:352:55588)
at listOnTimeout (node:internal/timers:568:17)
at process.processTimers (node:internal/timers:511:7)