TypeError: Cannot read property ‘name‘ of undefined at Qe.onShow

简介: TypeError: Cannot read property ‘name‘ of undefined at Qe.onShow

TypeError: Cannot read property 'name' of undefined


at Qe.onShow (http://127.0.0.1:19348/appservice/pages/index/index.js:52:37)


at Qe.<anonymous> (http://127.0.0.1:19348/appservice/__dev__/WASubContext.js?t=wechat&s=1710723521628&v=2.16.1:2:2492821)


at Qe.r.__callPageLifeTime__ (http://127.0.0.1:19348/appservice/__dev__/WASubContext.js?t=wechat&s=1710723521628&v=2.16.1:2:2492565)


at nn (http://127.0.0.1:19348/appservice/__dev__/WASubContext.js?t=wechat&s=1710723521628&v=2.16.1:2:2512288)


at http://127.0.0.1:19348/appservice/__dev__/WASubContext.js?t=wechat&s=1710723521628&v=2.16.1:2:2517166


at cn (http://127.0.0.1:19348/appservice/__dev__/WASubContext.js?t=wechat&s=1710723521628&v=2.16.1:2:2517705)


at Function.<anonymous> (http://127.0.0.1:19348/appservice/__dev__/WASubContext.js?t=wechat&s=1710723521628&v=2.16.1:2:2524077)


at c.<anonymous> (http://127.0.0.1:19348/appservice/__dev__/WASubContext.js?t=wechat&s=1710723521628&v=2.16.1:2:2483894)


at c.emit (http://127.0.0.1:19348/appservice/__dev__/WASubContext.js?t=wechat&s=1710723521628&v=2.16.1:2:612479)


at Object.emit (http://127.0.0.1:19348/appservice/__dev__/WASubContext.js?t=wechat&s=1710723521628&v=2.16.1:2:565013)


2

看到这些报错信息,我们顺着去寻找错误,TypeError: Cannot read property 'name' of undefined ,他报的错误类型是TypeError,Cannot read property 'name' of undefined ,说明应该是某个对象的属性name没用定义,at Qe.onShow (http://127.0.0.1:19348/appservice/pages/index/index.js:52:37),紧接着我们在根据这行信息定位错误代码,/pages/index/index.js:52:37,打开index.js查找52行附近的代码,解决问题,OK。


目录
相关文章
|
7天前
webpack版本问题 Cannot read property ‘createHash‘ of undefined
webpack版本问题 Cannot read property ‘createHash‘ of undefined
|
8天前
|
iOS开发 MacOS
TypeError: Cannot read property ‘shop‘ of undefined
TypeError: Cannot read property ‘shop‘ of undefined
11 0
|
8天前
|
JavaScript
JS中Null和Undefined的区别及用法
JS中Null和Undefined的区别及用法
16 1
|
8天前
|
JavaScript 前端开发 算法
undefined与null的区别
在JavaScript中,undefined和null都表示变量未被赋值或值缺失,但它们在使用场景上有一些区别。 - **`语义不同`**:undefined表示一个变量未被赋值或者声明后未进行初始化。而null表示一个变量被明确地设置为无值或者表示空值的概念。 - **`类型不同`**:undefined是一种基本数据类型,而null是一个引用类型。 - **`条件判断`**:在条件判断中,使用if (variable === undefined)或者if (variable === null)可以进行区分。
|
8天前
|
JavaScript 前端开发 程序员
分享18个用于处理 null、NaN 和undefined 的 JS 代码片段
Null、NaN 和 undefined 是程序员在使用 JavaScript 时遇到的常见值。 有效处理这些值对于确保代码的稳定性和可靠性至关重要。
|
8天前
|
JavaScript 前端开发 API
null和undefined:两个JavaScript中的特殊值(二)
null和undefined:两个JavaScript中的特殊值
|
8天前
|
JavaScript 前端开发 安全
null和undefined:两个JavaScript中的特殊值(一)
null和undefined:两个JavaScript中的特殊值
|
8月前
【已解决】TypeError: Cannot destructure property `createHash` of ‘undefined‘ or ‘null‘
【已解决】TypeError: Cannot destructure property `createHash` of ‘undefined‘ or ‘null‘
209 1
|
8天前
|
前端开发 JavaScript
【Web 前端】undefined 和 null 区别?
【4月更文挑战第22天】【Web 前端】undefined 和 null 区别?
【Web 前端】undefined 和 null 区别?
|
8天前
|
JavaScript 前端开发 Python
js中null和undefined的区别是什么
js中null和undefined的区别是什么
20 3