首页 > 解决方案 > ng build/serve not working 模板中的错误

问题描述

在尝试构建/服务使用 nx/Angular 8 创建的应用程序时遇到问题。有 3 个问题:

WARNING in Entry point '@angular/material' contains deep imports ... (rxjs/observable)
ERROR in template must be a string
i 「wdm」: Failed to compile.

解决问题的任何帮助表示赞赏。

浏览器显示:Cannot GET /

完整的错误是:

ng serve abc-app
  0% compiling
Compiling @angular/material : es2015 as esm2015                                                            10% building 3/3 modules 0 activei 「wds」: Project is running at http://localhost:4200/webpack-dev-server/
i 「wds」: webpack output is served from /
i 「wds」: 404s will fallback to //index.html
chunk {main} main.js, main.js.map (main) 2.01 kB [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 155 kB [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 6.09 kB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 1.82 MB [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 340 kB [initial] [rendered]
Date: 2019-08-14T02:06:54.559Z - Hash: 352c09b777f8eeb3654d - Time: 12744ms

WARNING in Entry point '@angular/material' contains deep imports into 'C:/ui/node_modules/rxjs/Subject', 'C:/ui/node_modules/rxjs/Subscription', 'C:/ui/node_modules/rxjs/observable/fromEvent', 'C:/ui/node_modules/rxjs/observable/merge', 'C:/ui/node_modules/rxjs/observable/of', 'C:/ui/node_modules/rxjs/Observable', 'C:/ui/node_modules/rxjs/observable/throw', 'C:/workspace/ui/node_modules/rxjs/observable/forkJoin'. This is probably not a problem, but may cause the compilation of entry points to be out of order.

ERROR in template must be a string
** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
i 「wdm」: Failed to compile.

标签: angularnpmangular8serve

解决方案


推荐阅读