Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

624
Vistas
How to fix ERROR in node_modules/chart.js/types/animation.d.ts(20,37): error TS1005: ',' expected. in chart.js

I am working on an Angular 6 project where I want to create some charts using chart.js.

I installed chart.js using npm install chart.js and its version is like 3.5.1. My TypeScript version is like 2.9.0.

So when I try to ng serve.

node_modules/chart.js/types/animation.d.ts(20,37): error TS1005: ',' expected.
node_modules/chart.js/types/animation.d.ts(20,46): error TS1005: ',' expected.
node_modules/chart.js/types/index.esm.d.ts(39,56): error TS1005: ';' expected.
node_modules/chart.js/types/index.esm.d.ts(39,58): error TS1011: An element access expression should take an argument.
node_modules/chart.js/types/index.esm.d.ts(39,85): error TS1005: '(' expected.
node_modules/chart.js/types/index.esm.d.ts(535,38): error TS1005: ',' expected.
node_modules/chart.js/types/index.esm.d.ts(535,56): error TS1005: ',' expected.
node_modules/chart.js/types/index.esm.d.ts(2424,37): error TS1005: ',' expected.
node_modules/chart.js/types/index.esm.d.ts(2424,50): error TS1005: ',' expected.
node_modules/chart.js/types/index.esm.d.ts(2734,63): error TS1005: ';' expected.
node_modules/chart.js/types/index.esm.d.ts(2734,69): error TS1011: An element access expression should take an argument.
node_modules/chart.js/types/index.esm.d.ts(2738,22): error TS1011: An element access expression should take an argument.
node_modules/chart.js/types/index.esm.d.ts(2742,63): error TS1005: '(' expected.
node_modules/chart.js/types/index.esm.d.ts(2746,57): error TS1005: '(' expected.
node_modules/chart.js/types/index.esm.d.ts(2746,68): error TS1005: ',' expected.
node_modules/chart.js/types/index.esm.d.ts(2746,75): error TS1011: An element access expression should take an argument.
node_modules/chart.js/types/index.esm.d.ts(2746,76): error TS1005: ')' expected.
node_modules/chart.js/types/index.esm.d.ts(2763,26): error TS1011: An element access expression should take an argument.
node_modules/chart.js/types/index.esm.d.ts(2767,67): error TS1005: '(' expected.
node_modules/chart.js/types/index.esm.d.ts(2771,56): error TS1005: '(' expected.
node_modules/chart.js/types/index.esm.d.ts(2771,67): error TS1005: ',' expected.
node_modules/chart.js/types/index.esm.d.ts(2771,73): error TS1011: An element access expression should take an argument.
node_modules/chart.js/types/index.esm.d.ts(2771,74): error TS1005: ')' expected.
node_modules/chart.js/types/index.esm.d.ts(2788,1): error TS1128: Declaration or statement expected.

What is this and how to fix this?

Thanks, Dasun.

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

I try out several solutions but could not find them, So I just downgrade the chartjs 3.5.1 to 2.7.3. So it is working fine.

over 4 years ago · Santiago Trujillo Denunciar

0

As others have stated, downgrading to chart.js version 2.7.3 fixed this for me. For anyone not super familiar with npm, here's the commands I used to update the package:

npm remove chart.js --save
npm install chart.js@2.7.3 --save

I specifically did this for my ionic 5 project. But it should also work for angular.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda