Angular 6 TypeError:无法读取未定义的属性"call" [英] Angular 6 TypeError: Cannot read property 'call' of undefined

查看:149
本文介绍了Angular 6 TypeError:无法读取未定义的属性"call"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am trying to migrate the angular app from 5 to 6 version. The app is running well but if I do some changes in my code after page reloading, I am facing a weird error:

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)

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

Did someone face this error? Why this error appears after code changing?

UPD

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

I was using ng serve --aol to run my app. If I use ng serve the error disappears

推荐答案

问题已解决angular-cli小组,您只需更新您的"webpack": "^4.15.1" 祝您好运.

Issue FIXED by angular-cli team, you just need to update your "webpack": "^4.15.1" Good luck.

这是我先前的答案.

This was my earlier answer.

这是一个开放标签:angular-cli中的comp: devkit/build-angular问题.

This is an open-label:comp: devkit/build-angular issue in angular-cli.

是的,您就在ng serve中,您没有看到错误.即使在开发应用程序时遇到相同的错误,我也结束了ng serve并再次尝试,它成功了,并且ng build --prod也成功了.请参考下面提供的链接,您将对此有所了解.

Yes, you are right in the ng serve you don't see the error. Even I faced the same error while developing my application, I did end my ng serve and tried again, it worked and the ng build --prod is also successful. Please refer to the below-provided link, you will get to know more on this.

https://github.com/angular/angular-cli/issues/11129

这篇关于Angular 6 TypeError:无法读取未定义的属性"call"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆