代码编译和运行中偶尔会报:Cannot read property ‘code’ of undefined。但是代码中出现code的地方只有一个app.js自动生成的并且在注释语句中。如下图:
搜索code得到的结果,如图:
同遇到,暂时没有发现哪里的问题。
比较怀疑的是。可能选择图片的时候会出现这个问题,似乎我这边报这个错误的都是拥有选择图片功能的页面
顺手贴一下完整的错误:
webviewScriptError
Cannot read property ‘code’ of undefined
TypeError: Cannot read property ‘code’ of undefined
at o._getRegionCodeByValue (<anonymous>:57:25157)
at <anonymous>:57:22198
at Object.w (<anonymous>:40:2398)
at Object.ret.invokeCallbackHandler (<anonymous>:20:28)
at <anonymous>:1:67
出现错误机型:
Mi Note 3
参数:
{“screenWidth”:393,
“screenHeight”:698,
“windowHeight”:630,
“language”:“zh_CN”,
“version”:“6.7.3”,
“system”:“Android 8.1.0”,
“fontSizeSetting”:16,
“pixelRatio”:2.75,
“model”:“Mi Note 3”,
“statusBarHeight”:20,
“deviceOrientation”:“portrait”,
“brand”:“Xiaomi”,
“windowWidth”:393,
“platform”:“android”,
“SDKVersion”:“2.4.1”}
EML-AL00
参数:
{“screenWidth”:360,
“screenHeight”:748,
“windowHeight”:672,
“language”:“zh_CN”,
“version”:“6.7.3”,
“system”:“Android 8.1.0”,
“fontSizeSetting”:16,
“pixelRatio”:2,
“model”:“EML-AL00”,
“statusBarHeight”:28,
“deviceOrientation”:“portrait”,
“brand”:“HUAWEI”,
“windowWidth”:360,
“platform”:“android”,
“SDKVersion”:“2.4.1”}