ERROR TypeError:无法读取属性' map'为null

时间:2017-10-27 09:31:41

标签: angular angular-cli

重启ng服务器后,我对模板进行了一些更改。我开始在控制台中收到错误。我恢复了工作代码但它仍然抛出相同的错误。我发现调试此错误非常困难,因为它没有指向模板文件。我使用的是角度cli。控制台中显示2个错误:

ERROR1:

  

错误类型错误:无法读取属性' map'为null       在splitDepsDsl(core.es5.js:8712)       at _def(core.es5.js:10695)       at directiveDef(core.es5.js:10652)       在View_AppComponent_Host_0(AppComponent_Host.html:1)       在proxyClass(compiler.es5.js:14971)       at resolveDefinition(core.es5.js:8756)       在ComponentFactory_.webpackJsonp ... / .. / .. / core/@angular/core.es5.js.ComponentFactory_.create(core.es5.js:9859)       在ComponentFactoryBoundToModule.webpackJsonp ... / .. / .. / core/@angular/core.es5.js.ComponentFactoryBoundToModule.create(core.es5.js:3333)       在ApplicationRef_.webpackJsonp ... / .. / .. / core/@angular/core.es5.js.ApplicationRef_.bootstrap(core.es5.js:4768)       在core.es5.js:4546

错误2:

  

zone.js:661未处理承诺拒绝:无法读取属性' map'无效;区域:;任务:Promise.then;值:TypeError:无法读取属性' map'为null       在splitDepsDsl(core.es5.js:8712)       at _def(core.es5.js:10695)       at directiveDef(core.es5.js:10652)       在View_AppComponent_Host_0(AppComponent_Host.html:1)       在proxyClass(compiler.es5.js:14971)       at resolveDefinition(core.es5.js:8756)       在ComponentFactory_.webpackJsonp ... / .. / .. / core/@angular/core.es5.js.ComponentFactory_.create(core.es5.js:9859)       在ComponentFactoryBoundToModule.webpackJsonp ... / .. / .. / core/@angular/core.es5.js.ComponentFactoryBoundToModule.create(core.es5.js:3333)       在ApplicationRef_.webpackJsonp ... / .. / .. / core/@angular/core.es5.js.ApplicationRef_.bootstrap(core.es5.js:4768)       at core.es5.js:4546 TypeError:无法读取属性' map'为null       在splitDepsDsl(http://localhost:4200/vendor.bundle.js:100930:17)       在_def(http://localhost:4200/vendor.bundle.js:102913:36)       at directiveDef(http://localhost:4200/vendor.bundle.js:102870:12)       在View_AppComponent_Host_0(ng:///AppModule/AppComponent_Host.ngfactory.js:6:67)       在proxyClass(http://localhost:4200/vendor.bundle.js:79342:29)       at resolveDefinition(http://localhost:4200/vendor.bundle.js:100974:17)       在ComponentFactory_.webpackJsonp ... / .. / .. / core/@angular/core.es5.js.ComponentFactory_.create(http://localhost:4200/vendor.bundle.js:102077:40)       在ComponentFactoryBoundToModule.webpackJsonp ... / .. / .. / core/@angular/core.es5.js.ComponentFactoryBoundToModule.create(http://localhost:4200/vendor.bundle.js:95551:29)       at ApplicationRef_.webpackJsonp ... / .. / .. / core/@angular/core.es5.js.ApplicationRef_.bootstrap(http://localhost:4200/vendor.bundle.js:96986:57)       在http://localhost:4200/vendor.bundle.js:96764:81

1 个答案:

答案 0 :(得分:0)

错误是由于角度破坏了包裹。我运行yarn upgrade命令修复了这个问题。