b***@163.com
b***@163.com
  • 发布:2022-09-16 16:47
  • 更新:2022-09-16 17:07
  • 阅读:223

莫名其妙的报错

分类:HBuilderX

这个错误是偶发性的,经常发生在某一天刚开机刚打开项目的时候。比如昨天项目还是好好的,然后保存,今天一开机刚打开项目就会报这个错。
然后,再过一会儿,就会发现不再报错了,项目正常运行。请注意,这期间我什么都没做。就是过一会儿就好,时间不一定。因此我猜有可能不是程序的问题,是不是webpack哪里设置错了?

请帮我看看有可能是哪里出问题了? 简直莫名其妙,都不知道从哪里开始排查!代码就不贴了,太多了,都不知道贴哪一段

报错信息:
Uncaught TypeError: Cannot read properties of undefined (reading 'length')
at chunk-vendors.js:33400:124606
at Object.<anonymous> (chunk-vendors.js:33400:125311)
at Object.qf9q (chunk-vendors.js:33401:30)
at webpack_require (index.js:854:30)
at fn (index.js:151:20)
at eval (Do9a:514:41)
at Object.Do9a (index.js:1086:1)
at webpack_require (index.js:854:30)
at fn (index.js:151:20)
at eval (App.vue:2:1)

2022-09-16 16:47 负责人:无 分享
已邀请:
efficient_work

efficient_work

搜索代码:.length

b***@163.com

b***@163.com (作者)

这个length应该不是我写的,应该是unicloud的源码里的。

b***@163.com

b***@163.com (作者)

我写的length的地方,都是先判断是否为undefined或null。

b***@163.com

b***@163.com (作者)

贴个全一点的报错信息。 请注意第一句话[HMR] Waiting for update signal from WDS... 我猜可能是没有等到,因此就是读了undefined 的length

[HMR] Waiting for update signal from WDS...
chunk-vendors.js:33400 Uncaught TypeError: Cannot read properties of undefined (reading 'length')
at chunk-vendors.js:33400:124606
at Object.<anonymous> (chunk-vendors.js:33400:125311)
at Object.qf9q (chunk-vendors.js:33401:30)
at webpack_require (index.js:854:30)
at fn (index.js:151:20)
at eval (Do9a:514:41)
at Object.Do9a (index.js:1086:1)
at webpack_require (index.js:854:30)
at fn (index.js:151:20)
at eval (App.vue:2:1)
(匿名) @ chunk-vendors.js:33400
(匿名) @ chunk-vendors.js:33400
qf9q @ chunk-vendors.js:33401
webpack_require @ index.js:854
fn @ index.js:151
eval @ Do9a:514
Do9a @ index.js:1086
webpack_require @ index.js:854
fn @ index.js:151
eval @ App.vue:2
38SB @ index.js:1034
webpack_require @ index.js:854
fn @ index.js:151
eval @ null:1
BTO9 @ index.js:1058
webpack_require @ index.js:854
fn @ index.js:151
eval @ null:1
m7d1 @ index.js:2769
webpack_require @ index.js:854
fn @ index.js:151
eval @ main.js:1
zQXr @ index.js:2805
webpack_require @ index.js:854
fn @ index.js:151
1 @ index.js:1021
webpack_require @ index.js:854
checkDeferredModules @ index.js:46
(匿名) @ index.js:994
(匿名) @ index.js:997
chunk-vendors.js:10133 Download the Vue Devtools extension for a better development experience:
https://github.com/vuejs/vue-devtools
chunk-vendors.js:10143 You are running Vue in development mode.
Make sure to turn on production mode when deploying for production.
See more tips at https://vuejs.org/guide/deployment.html

要回复问题请先登录注册