how can i fix ng2 chart issues?

Build at: 2021-05-14T23:43:39.491Z - Hash: 9bd5fc57f8096f30771e - Time: 18132ms

Error: node_modules/ng2-charts/lib/base-chart.directive.d.ts:33:12 - error TS2304: Cannot find name 'Chart'.

33 chart: Chart; ~~~~~

Error: node_modules/ng2-charts/lib/base-chart.directive.d.ts:4:115 - error TS2305: Module '"../../chart.js/types/index.esm"' has no exported member 'PluginServiceRegistrationOptions '.

4 import { ChartConfiguration, ChartDataSets, ChartOptions, ChartPoint, ChartType, PluginServiceGlobalRegistration, PluginServiceRegistrationOptions } from 'chart.js'; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: node_modules/ng2-charts/lib/base-chart.directive.d.ts:4:30 - error TS2724: '"../../chart.js/types/index.esm"' has no exported member named 'ChartDataSets'. Did you mean 'Char tDataset'?

4 import { ChartConfiguration, ChartDataSets, ChartOptions, ChartPoint, ChartType, PluginServiceGlobalRegistration, PluginServiceRegistrationOptions } from 'chart.js'; ~~~~~~~~~~~~~

Error: node_modules/ng2-charts/lib/base-chart.directive.d.ts:4:59 - error TS2305: Module '"../../chart.js/types/index.esm"' has no exported member 'ChartPoint'.m

4 import { ChartConfiguration, ChartDataSets, ChartOptions, ChartPoint, ChartType, PluginServiceGlobalRegistration, PluginServiceRegistrationOptions } from 'chart.js'; ~~~~~~~~~~

Error: node_modules/ng2-charts/lib/base-chart.directive.d.ts:4:82 - error TS2305: Module '"../../chart.js/types/index.esm"' has no exported member 'PluginServiceGlobalRegistration'.

4 import { ChartConfiguration, ChartDataSets, ChartOptions, ChartPoint, ChartType, PluginServiceGlobalRegistration, PluginServiceRegistrationOptions } from 'chart.js'; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: node_modules/ng2-charts/lib/base-chart.directive.d.ts:57:35 - error TS2304: Cannot find name 'Chart'.

57 getChartBuilder(ctx: string): Chart; ~~~~~

Error: ./node_modules/ng2-charts/ivy_ngcc/fesm2015/ng2-charts.js 317:8-21 "export 'pluginService' was not found in 'chart.js'

Error: ./node_modules/ng2-charts/ivy_ngcc/fesm2015/ng2-charts.js 324:8-21 "export 'pluginService' was not found in 'chart.js'


even after downgraded the version of chart.js to 2.9.3 and ng2-chart to 2.4.2 , and added "allowedCommonJsDependencies": ["chart.js"] , i still get those issues , what should i do !