gpt4 book ai didi

Angular 6 类型错误 : Cannot read property 'call' of undefined

转载 作者:太空狗 更新时间:2023-10-29 17:23:03 25 4
gpt4 key购买 nike

我正在尝试将 Angular 应用程序从 5 版本迁移到 6 版本。该应用程序运行良好,但如果我对代码进行一些更改页面重新加载后,我遇到了一个奇怪的错误:

core.js:1598 ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'call' of undefined
TypeError: Cannot read property 'call' of undefined
at __webpack_require__ (bootstrap:81)
at Object../src/app/secure/dashboard/member-index/member-index.module.ngfactory.js (member-index.component.ts:33)
at __webpack_require__ (bootstrap:81)
at $_lazy_route_resource lazy namespace object:56
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:388)
at Object.onInvoke (core.js:4062)
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:387)
at Zone.push../node_modules/zone.js/dist/zone.js.Zone.run (zone.js:138)
at zone.js:872
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:421)
at __webpack_require__ (bootstrap:81)
at Object../src/app/secure/dashboard/member-index/member-index.module.ngfactory.js (member-index.component.ts:33)
at __webpack_require__ (bootstrap:81)
at $_lazy_route_resource lazy namespace object:56
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:388)
at Object.onInvoke (core.js:4062)
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:387)
at Zone.push../node_modules/zone.js/dist/zone.js.Zone.run (zone.js:138)
at zone.js:872
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:421)
at resolvePromise (zone.js:814)
at resolvePromise (zone.js:771)
at zone.js:873
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:421)
at Object.onInvokeTask (core.js:4053)
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:420)
at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:188)
at drainMicroTaskQueue (zone.js:595)

有人遇到过这个错误吗?为什么改代码后会出现这个错误?

UPD

我正在使用 ng serve --aol 来运行我的应用程序。如果我使用 ng serve 错误就会消失

最佳答案

我认为当您在运行时更改模块导入时会发生这种情况。

使用 ng serve 再次运行应用程序,它为我解决了这个问题。

当您尝试在加载惰性模块之前在其他模块中使用惰性加载模块的组件或类似情况时,也可能会发生这种情况。

关于 Angular 6 类型错误 : Cannot read property 'call' of undefined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50375181/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com