简体   繁体   English

Angular 8 无法读取未定义的属性“地图”

[英]Angular 8 Cannot read property 'map' of undefined

I am using Angular 8 for a project and after I installed @angular/material I tried to serve the application and I got this error.我正在为一个项目使用 Angular 8,在我安装 @angular/material 后,我尝试为应用程序提供服务,但出现此错误。 Never happened before, I get no stack at all.. that's it.以前从未发生过,我根本没有堆栈..就是这样。 Does anyone know something?有人知道吗? Searching on the internet I found nothing.在互联网上搜索我一无所获。

I added lines to the code below so I can refer to:我在下面的代码中添加了行,以便我可以参考:

  • line 13 is the error第 13 行是错误
  • line 3 I read something strange, what does that mean?第 3 行我读到一些奇怪的东西,这是什么意思? Angular compiler specifies to compile es2015.. Angular编译器指定编译es2015..

Thanks谢谢

1 ng serve
2 0% compiling
3 Compiling @angular/core : es2015 as esm2015
4 10% building 3/3 modules 0 activei 「wds」: Project is running at http://localhost:4200/webpack-dev-server/
5 i 「wds」: webpack output is served from /
6 i 「wds」: 404s will fallback to //index.html

7 chunk {main} main.js, main.js.map (main) 2.02 kB [initial] [rendered]
8 chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 127 kB [initial] [rendered]
9 chunk {runtime} runtime.js, runtime.js.map (runtime) 6.15 kB [entry] [rendered]
10 chunk {styles} styles.js, styles.js.map (styles) 1.29 MB [initial] [rendered]
11 chunk {vendor} vendor.js, vendor.js.map (vendor) 340 kB [initial] [rendered]
12 Date: 2020-05-14T10:52:07.242Z - Hash: f6d075528a2e8bb42b38 - Time: 3912ms

13 ERROR in Cannot read property 'map' of undefined
14 ** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
15 i 「wdm」: Failed to compile.

Before ng serve , execute npm installng serve之前,执行npm install

This will brings all the node modules to your project through CLI..这将通过 CLI 将所有节点模块带到您的项目中。

I solved the issue by downgrading the @angular/core module to 9.15!我通过将@angular/core 模块降级到 9.15 解决了这个问题!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Angular:TypeError:无法读取未定义的属性“map” - Angular: TypeError: Cannot read property 'map' of undefined TypeError:无法读取未定义的属性“地图”<angular 8></angular> - TypeError: Cannot read property 'map' of undefined<Angular 8 > Angular2地图“无法读取未定义的属性&#39;地图&#39;” - Angular2 Map “Cannot read property 'map' of undefined” 无法读取 undefined.ANGULAR-CHARTJS 的属性“地图” - Cannot read property 'map' of undefined.ANGULAR-CHARTJS Angular TypeError:无法使用@Input 装饰器读取未定义的属性“映射” - Angular TypeError: Cannot read property 'map' of undefined with @Input decorator Angular 2在初始化第二个映射时无法读取未定义的属性“maps” - Angular 2 Cannot read property 'maps' of undefined while init second map 从 Angular 7 更新到 8 后,“无法读取未定义属性‘地图’中的错误” - "ERROR in Cannot read property 'map' of undefined" after updating from Angular 7 to 8 无法使用带有ngrx的angular读取未定义的属性“映射” - Cannot read property 'map' of undefined using angular with ngrx Angular Ngrx 8 选择器错误:无法读取未定义的属性“映射” - Angular Ngrx 8 Selector error: Cannot read property 'map' of undefined Angular 8 webpack AOT 构建失败 - 无法读取未定义的属性“地图” - Angular 8 webpack AOT build failed - Cannot read property 'map' of undefined
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM