Home > Software engineering >  Uprading to [email protected] with Angular 8
Uprading to [email protected] with Angular 8

Time:03-06

I'm attempting to upgrade from chart.js 2.9.4 to chart.js 3.x to drop the massive moment.js dependency. My app is running angular 8.2.3 and typescript 3.5.3.

After installing [email protected] I receive this error when importing the package:

node_modules/chart.js/types/utils.d.ts:13:49 - error TS2315: Type 'DeepPartial' is not generic.

13 type _DeepPartialObject<T> = { [P in keyof T]?: DeepPartial<T[P]> };

Is it possible to upgrade to [email protected] with angular 8.2.3? Chart.js doesn't say anything about version 3 requiring a newer typescript version, and I'm unable to find any solutions out there.

Thanks for the help!

CodePudding user response:

Chart.js never supported typescript before Chart.js V3. So it does not need to mention that it requires a newer version of typescript because it never supported it.

Every stable version of Chart.js V3 requires Typescript V4. There are also no plans in supporting typescript V3 as its too old as described in this git issue.

So if you want to use it with angular 8.2.3 you will need to disable type checking or update the typings yourself that they are compatible with typescript V3

  • Related