[英]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:我在下面的代码中添加了行,以便我可以参考:
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 install在ng 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.