twp0217 / ngx-echarts

Apache ECharts component for Angular(基于 Angular 的 Apache ECharts 组件)
https://twp0217.github.io/ngx-echarts/
82 stars 25 forks source link

use with Angular5 #25

Closed shenchaoran closed 6 years ago

shenchaoran commented 6 years ago

在ng5中使用时,提示以下错误

ERROR in ./node_modules/echarts-ng2/src/component/echarts-ng2.component.ts
Module build failed: Error: F:\Angular\WebNJGIS_frontend\node_modules\echarts-ng2\src\component\echarts-ng2.component.ts is missing from the TypeScript
compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
The missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library. Please open an issue in the library repository to alert its author and ask them to package the library using the Angular Package Format (https://goo.gl/jB3GVv).
    at AngularCompilerPlugin.getCompiledFile (F:\Angular\WebNJGIS_frontend\node_modules\@ngtools\webpack\src\angular_compiler_plugin.js:653:23)
    at plugin.done.then (F:\Angular\WebNJGIS_frontend\node_modules\@ngtools\webpack\src\loader.js:467:39)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
 @ ./node_modules/echarts-ng2/src/index.js 6:9-53
 @ ./src/app/business/visualization/visualization.module.ts
 @ ./src/app/business/comparison/comparison.module.ts
 @ ./src/$$_lazy_route_resource lazy
 @ ./node_modules/@angular/core/esm5/core.js
 @ ./src/main.ts
 @ multi webpack-dev-server/client?http://0.0.0.0:0 ./src/main.ts

当我按照提示将node_modules中的文件加入到tsconfig中还是不管用

"include": [
        "node_modules/echart-ng2/**/*"
    ]

请问该怎么解决啊?

twp0217 commented 6 years ago

参考下这个:https://github.com/twp0217/echarts-ng2/issues/22#issuecomment-350181289

shenchaoran commented 6 years ago

不是ng5的问题,确实是tsconfig的问题,非常感谢!