【发布时间】:2020-07-30 15:06:12
【问题描述】:
我在使用 ngx-echarts 时得到了这个。使用 4.x.x 版本时一切正常。在 npm i 之后,应用程序无法运行。
【问题讨论】:
标签: angular typescript echarts
我在使用 ngx-echarts 时得到了这个。使用 4.x.x 版本时一切正常。在 npm i 之后,应用程序无法运行。
【问题讨论】:
标签: angular typescript echarts
问题是由于 ngxe-charts 中的版本更新。如果使用 >5.0 的版本,请在 app.module 中使用它
NgxEchartsModule.forRoot({
echarts: { init: echarts.init }
})
在 tsconfig.json 的角度编译器选项中也添加这个
"enableIvy": false
【讨论】:
@Arokia Lijas 提出的解决方案对我不起作用它在 build --prod 中产生了错误
所以我找到了这个:
export function chartModule(): any {
return import('echarts');
}
在 NgModule 中:
NgxEchartsModule.forRoot({
echarts: chartModule
}),
它确实对我很有效。 来源:https://github.com/xieziyu/ngx-echarts/issues/241#issuecomment-742777787
【讨论】: