'ChartsModule' does not appear to be an NgModule, Component, Directive, or Pipe class

318 Views Asked by At

I have installed chart.js and ng2charts, the version details are below:

 "chart.js": "^2.9.4",
 "chartjs-gauge": "^0.3.0",
 "ng2-charts": "^2.4.3"

On import it's showing the error: 'ChartsModule' does not appear to be an NgModule, Component, Directive, or Pipe class.(-996003) charts.module.d.ts(1, 22): This likely means that the library (ng2-charts) which declares ChartsModule is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library's authors to see if the library is expected to be compatible with Ivy.

And when I replace "ChartsModule" with "NgChartsModule", It's showing the below error :

'"ng2-charts"' has no exported member named 'NgChartsModule'. Did you mean 'ChartsModule'?

  • Note : Before Angular upgrade, I was using 'NgChartsModule'. And it was working fine.

I upgrade my angular version from 11 to 16 and after that chart library is not working. I have tried with newer/latest version of both the libraries but that too did not work.

Any suggestions?

Thank you!

0

There are 0 best solutions below