WARNING in ./node_modules/ng2-charts/fesm5/ng2-charts.js 230:54-72 "export '??defineInjectable' was not found in '@angular/core'

Was*_*siF 21 ng2-charts angular angular7

I am using ng2-charts in Angular 7 app and having warning

WARNING in ./node_modules/ng2-charts/fesm5/ng2-charts.js 230:54-72 "export '??defineInjectable' was not found in '@angular/core'

error in VS Code

在此处输入图片说明

error in browser

在此处输入图片说明

What could be the reason and how to resolve it?

Was*_*siF 40

ng2-charts v2.2.4 has this bug as lots of users are reporting that so down-grading to ng2-charts v2.2.3 is fine until it is fixed in the future releases.

npm install ng2-charts@2.2.3
Run Code Online (Sandbox Code Playgroud)

  • 版本2.2.5也可以正常工作。 (4认同)
  • 降级效果很好。只需`npm install ng2-charts@2.2.3 --save`并等待它更新 (2认同)