升级Angular项目后,"Uncaught TypeError:Object.setPrototypeOf在null或undefined上调用"

Sla*_* II 6 typescript angular

我有一个Angular应用程序,它完美地运行.但是,使用后升级依赖项后yarn upgrade,我得到了这个神秘的错误:

main.bundle.js:6779 Uncaught TypeError: Object.setPrototypeOf called on null or undefined
    at setPrototypeOf (<anonymous>)
    at webpackJsonp.../../../../../src/ui-components/src/components/phone-number-input/phone-number-input.component.ts.__extends (main.bundle.js:6779)
    at phone-number-input.component.ts:24
    at Object.../../../../../src/ui-components/src/components/phone-number-input/phone-number-input.component.ts (phone-number-input.component.ts:69)
    at __webpack_require__ (bootstrap 8652e46ce92ee05aa5a3:54)
    at Object.../../../../../src/ui-components/src/components/phone-number-input/phone-number-input.module.ts (phone-number-input.component.ts:24)
    at __webpack_require__ (bootstrap 8652e46ce92ee05aa5a3:54)
    at Object.../../../../../src/ui-components/src/ui-components.module.ts (roman-numeral.pipe.ts:10)
    at __webpack_require__ (bootstrap 8652e46ce92ee05aa5a3:54)
    at Object.../../../../../src/app/app.module.ts (app.component.ts:31)
webpackJsonp.../../../../../src/ui-components/src/components/phone-number-input/phone-number-input.component.ts.__extends @ main.bundle.js:6779
(anonymous) @ phone-number-input.component.ts:24
../../../../../src/ui-components/src/components/phone-number-input/phone-number-input.component.ts @ phone-number-input.component.ts:69
__webpack_require__ @ bootstrap 8652e46ce92ee05aa5a3:54
../../../../../src/ui-components/src/components/phone-number-input/phone-number-input.module.ts @ phone-number-input.component.ts:24
__webpack_require__ @ bootstrap 8652e46ce92ee05aa5a3:54
../../../../../src/ui-components/src/ui-components.module.ts @ roman-numeral.pipe.ts:10
__webpack_require__ @ bootstrap 8652e46ce92ee05aa5a3:54
../../../../../src/app/app.module.ts @ app.component.ts:31
__webpack_require__ @ bootstrap 8652e46ce92ee05aa5a3:54
../../../../../src/main.ts @ environment.ts:10
__webpack_require__ @ bootstrap 8652e46ce92ee05aa5a3:54
2 @ ui-components.module.ts:108
__webpack_require__ @ bootstrap 8652e46ce92ee05aa5a3:54
webpackJsonpCallback @ bootstrap 8652e46ce92ee05aa5a3:25
(anonymous) @ main.bundle.js:1
Run Code Online (Sandbox Code Playgroud)

当遵循指定的文件和行号时,我找不到任何问题.IDE显示没有问题,编译发生没有错误.

当试图注释掉错误中提到的组件时,它只是开始提到另一个组件.

可能导致这种情况的原因以及如何调试/调查这个神秘错误?

Sla*_* II 13

没有任何有意义的错误消息和堆栈跟踪告诉我几乎没有.我决定调查实际触发这个问题的是什么.考虑到它出现在依赖项升级之后,我已经提取了diff yarn.lock并开始恢复它的某些部分并重新编译应用程序,检查它是否会使错误消失.经过一番繁琐的工作我发现它是由打字稿造成被更新2.3.42.4.0.

因此,下一步将是研究更改日志并分析我的代码中可能出现的问题.

因此,最后我建议更频繁地升级您的依赖项(这将有助于减少升级大小,以防您需要进行调查).

我希望它会对某人有所帮助.干杯!

更新

  • 希望我能不止一次地投票.字面上节省了我的一天.非常感谢 ! (2认同)