Module '"ng2-charts"' has no exported member in v6
elementalTIMING opened this issue · 1 comments
elementalTIMING commented
After updating to v6.0.0 it's no longer possible to compile:
Module '"ng2-charts"' has no exported member 'NgChartsModule'.
import { NgChartsModule } from 'ng2-charts';
How to fix? I already tried to remove npm cache and run a complete new npm install
crodriguez6497 commented
That was intentional and was mentioned as a breaking change in the changelog for v6.0.0. You need to import the library in standalone mode, per #1801.
i.e.
import { provideCharts, withDefaultRegisterables } from 'ng2-charts';
@NgModule({
providers: [provideCharts(withDefaultRegisterables())],
bootstrap: [AppComponent],
})
export class AppModule {}