Angularjs   发布时间:2022-04-20  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了升级Angular项目后,“Uncaught TypeError:Object.setPrototypeOf在null或undefined上调用”大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我有一个Angular应用程序,它完美地运行.但是,在使用yarn升级升级依赖项之后,我遇到了这个神秘的错误: @H_676_1@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

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

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

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

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

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

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

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

更新

>经过进一步调查后,我发现了发生此错误的确切情况,因此我将posted an issue转到Angular GitHub存储库.
>最后,这是TypeScript中的actual culprit issue.

大佬总结

以上是大佬教程为你收集整理的升级Angular项目后,“Uncaught TypeError:Object.setPrototypeOf在null或undefined上调用”全部内容,希望文章能够帮你解决升级Angular项目后,“Uncaught TypeError:Object.setPrototypeOf在null或undefined上调用”所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。