Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript Error When Using ng-apexcharts During Build Time #342

Open
jxtorrez opened this issue Jun 21, 2024 · 4 comments
Open

TypeScript Error When Using ng-apexcharts During Build Time #342

jxtorrez opened this issue Jun 21, 2024 · 4 comments

Comments

@jxtorrez
Copy link

TypeScript Error When Using ng-apexcharts During Build Time

Description

I'm encountering a TypeScript error when trying to use ng-apexcharts in my Angular project. Specifically, I'm seeing the following error message:

Error: node_modules/ng-apexcharts/lib/chart/chart.component.d.ts:59:80 - error TS2344: Type '{ chart: { alias: "chart"; required: false; }; annotations: { alias: "annotations"; required: false; }; colors: { alias: "colors"; required: false; }; dataLabels: { alias: "dataLabels"; required: false; }; ... 18 more ...; autoUpdateSeries: { ...; }; }' does not satisfy the constraint '{ [key: string]: string; }'.
  Property '"chart"' is incompatible with index signature.
    Type '{ alias: "chart"; required: false; }' is not assignable to type 'string'.

59     static ɵcmp: i0.ɵɵComponentDeclaration<ChartComponent, "apx-chart", never, { "chart": { "alias": "chart"; "required": false; }; "annotations": { "alias": "annotations"; "required": false; }; "colors": { "alias": "colors"; "required": false; }; "dataLabels": { "alias": "dataLabels"; "required": false; }; "series": { "alias": "series"; "required": false; }; "stroke": { "alias": "stroke"; "required": false; }; "labels": { "alias": "labels"; "required": false; }; "legend": { "alias": "legend"; "required": false; }; "markers": { "alias": "markers"; "required": false; }; "noData": { "alias": "noData"; "required": false; }; "fill": { "alias": "fill"; "required": false; }; "tooltip": { "alias": "tooltip"; "required": false; }; "plotOptions": { "alias": "plotOptions"; "required": false; }; "responsive": { "alias": "responsive"; "required": false; }; "xaxis": { "alias": "xaxis"; "required": false; }; "yaxis": { "alias": "yaxis"; "required": false; }; "forecastDataPoints": { "alias": "forecastDataPoints"; "required": false; }; "grid": { "alias": "grid"; "required": false; }; "states": { "alias": "states"; "required": false; }; "title": { "alias": "title"; "required": false; }; "subtitle": { "alias": "subtitle"; "required": false; }; "theme": { "alias": "theme"; "required": false; }; "autoUpdateSeries": { "alias": "autoUpdateSeries"; "required": false; }; }, { "chartReady": "chartReady"; }, never, never, false, never>;

Steps to Reproduce:

  1. Install ng-apexcharts using npm.
  2. Set up a basic chart according to the documentation.
  3. While attempting to compile, I encountered the error mentioned above.

Steps Tried:

  • Reinstalled dependencies using npm install.
  • Verified that the version of ng-apexcharts in package.json is "1.11.0".

Environment:

  • Angular CLI version: 15
  • Node.js version: 20

Please help me.

@abieru
Copy link

abieru commented Jul 1, 2024

i have the same error

@dnyanesh94
Copy link

I am also facing same issue. node 16, 18, 22 with these version

@abieru
Copy link

abieru commented Jul 18, 2024

work on version 1.10.0 ng-apexchart

@Digui225
Copy link

Digui225 commented Oct 2, 2024

work on version 1.10.0 ng-apexchart

Merci beaucoup, j'ai resolu mon erreur grace à ta solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants