加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

升级Angular项目后,“Uncaught TypeError:Object.setPrototypeO

发布时间:2020-12-17 08:53:13 所属栏目:安全 来源:网络整理
导读:我有一个Angular应用程序,它完美地运行.但是,在使用yarn升级升级依赖项之后,我遇到了这个神秘的错误: main.bundle.js:6779 Uncaught TypeError: Object.setPrototypeOf called on null or undefined at setPrototypeOf (anonymous) at webpackJsonp.../../.
我有一个Angular应用程序,它完美地运行.但是,在使用yarn升级升级依赖项之后,我遇到了这个神秘的错误:
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.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读