vscode 运行调试报错

每次在vscode 运行调试时,【新建的空白项目helloworld 也同样问题】
只要勾选上 ::ballot_box_with_check:捕获的异常 就会在运行时报错:

发生异常:TypeError: Array.prototype.every called on null or undefined at every

发生异常: TypeError: Array.prototype.every called on null or undefined
at every ()
at http://localhost:7456/scripting/polyfills/bundle.js:2887:19
at module.exports (http://localhost:7456/scripting/polyfills/bundle.js:1221:21)
at module.exports (http://localhost:7456/scripting/polyfills/bundle.js:2885:29)
at Object. (http://localhost:7456/scripting/polyfills/bundle.js:2866:18)
at webpack_require (http://localhost:7456/scripting/polyfills/bundle.js:78:28)
at Object. (http://localhost:7456/scripting/polyfills/bundle.js:315:8)
at webpack_require (http://localhost:7456/scripting/polyfills/bundle.js:78:28)
at http://localhost:7456/scripting/polyfills/bundle.js:270:15
at http://localhost:7456/scripting/polyfills/bundle.js:272:8

新建的空白项目 helloWorld 也会在debug时报错 :sweat_smile:
新建的空白项目 helloWorld 也会在debug时报错 :sweat_smile:
新建的空白项目 helloWorld 也会在debug时报错 :sweat_smile:

每次在vscode 里调试,都是先 关闭调试选项 □捕获的异常。
等浏览器进入游戏后, 再开启 :ballot_box_with_check:捕获的异常。才行

这个报错是bundle.js 里的错误
是不是我的jsconfig.json 需要改什么啊?

有知道的大牛吗

2赞

Array.prototype.every called on null or undefined at every
Array.prototype.every在null或undefined时调用
看翻译

感觉是环境问题 或 编译选项的问题

新建的空白项目,只写一个hellowWorld 调试,也会这样

可能是js环境没准备好

1赞

这个错误信息是JavaScript中的一个异常,提示你在某个地方尝试在一个null或undefined值上调用 Array.prototype.every 方法,但这是不允许的。

要解决这个问题,你需要跟踪错误发生的位置并检查相关代码以找出哪个变量或对象是null或undefined。以下是一些可能的步骤:

  1. 查看堆栈跟踪 :堆栈跟踪信息中通常会包含错误发生的文件和行号。你可以查看这些信息,以找出哪个文件中的代码引发了异常。
  2. 检查每一步的代码 :一旦确定了引发异常的代码所在的文件,仔细检查相关代码,特别是涉及到 Array.prototype.every 的地方。确保你正在操作的数组不是null或undefined。
  3. 处理可能的null或undefined情况 :如果你发现某个变量可能为null或undefined,你可以在使用它之前添加条件检查来防止异常。例如:

javascriptCopy code

if (myArray && myArray.length > 0) {
  // 执行操作
} else {
  // 处理数组为空的情况
}
  1. 打印调试信息 :你可以在代码中添加 console.log 语句来输出变量的值,以便更好地理解代码的执行流程,并找出问题所在。

在你找到问题并修复之后,确保进行测试以验证代码是否再次正常工作。这可以通过在浏览器的开发者工具中查看控制台输出来进行测试,以确保不再出现异常。

新建的空项目,只建立一个ts类,不写任何代码。挂到节点上。

在vsCode里debug 就会报错的。

有解决方案了没

不可能吧 我天天用3.72新建hello world也没见到报错呀

吾知,莫名其妙出现,又莫名其妙好了。。。

蹲一个 我也遇到了。。

有解决方案吗?
Exception has occurred: TypeError: Array.prototype.every called on null or undefined
at every ()
at http://localhost:7456/scripting/polyfills/bundle.js:2887:19
at module.exports (http://localhost:7456/scripting/polyfills/bundle.js:1221:21)
at module.exports (http://localhost:7456/scripting/polyfills/bundle.js:2885:29)
at Object. (http://localhost:7456/scripting/polyfills/bundle.js:2866:18)
at webpack_require (http://localhost:7456/scripting/polyfills/bundle.js:78:28)
at Object. (http://localhost:7456/scripting/polyfills/bundle.js:315:8)
at webpack_require (http://localhost:7456/scripting/polyfills/bundle.js:78:28)
at http://localhost:7456/scripting/polyfills/bundle.js:270:15
at http://localhost:7456/scripting/polyfills/bundle.js:272:8

3.8.6 问题复现

这个问题一年多了 。。