ngx-echarts
ngx-echarts copied to clipboard
TypeError: Cannot destructure property 'init' of 'object null' as it is null.
Angular版本:8.3.0 echarts版本:4.9.0 ngx-echarts版本:5.2.1 本地开发,npm run start都没有问题,图表也能正常访问。npm run build本地打包也没有报错。 但是部署打包后的文件到nginx里面访问就会报标题的那个错,图表也显示不出来。 stackoverflow有人遇到过这个问题,但是似乎也无法解决这个报错。
查看控制台报错指向这里
大家有没有遇到同样的问题
遇到了同样的问题
Angular 8.2
"ngx-echarts": "5.2.2",
"echarts": "5.0.2",
This problem with ng build --prod
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true
},
"angularCompilerOptions": {
"enableIvy": false,
}
I use
NgxEchartsModule.forRoot({echarts}),
Since in the case of
NgxEchartsModule.forRoot({ echarts: () => import('echarts') }),
The error drops as in this issue: https://github.com/xieziyu/ngx-echarts/issues/283
遇到了同样的问题,已经回退 4.2.2 版本了。