Open Huncuska opened 1 month ago
I am facing the same error using pnpm and:
Application bundle generation failed. [6.013 seconds]
β [ERROR] TS2307: Cannot find module 'chart.js/dist/types/utils' or its corresponding type declarations. [plugin angular-compiler]
../node_modules/.pnpm/ng2-charts@6.0.1_@angular+cdk@18.1.0_@angular+common@18.1.0_@angular+core@18.1.0_@angular+pla_jqs4iodj7gs6carqputrxejine/node_modules/ng2-charts/lib/ng-charts.provider.d.ts:3:28:
3 β import { DeepPartial } from 'chart.js/dist/types/utils';
As this is a typescript error regarding not finding a type definition a possible temporary solution would be to disable LibChecking in tsconfig.json file via:
{
"skipLibCheck": true
}
I started to run into this issue today whilst changing tsconfig from
"module": "ES2022",
"moduleResolution": "node",
to
"module": "ES2022",
"moduleResolution": "bundler",
This change is needed to support typescript-eslint compatible with eslint 9
https://github.com/typescript-eslint/typescript-eslint/issues/7284
I need a solution that will support both ng2-charts and eslint 9/typescript-eslint.
Same, switched from 'node' to 'bundler' & now can't compile.
FWIW, I could make it work by adding this to tsconfig.json:
{
"compilerOptions": {
"paths": {
"chart.js/dist/types/utils": ["node_modules/chart.js/dist/types/utils.d.ts"]
}
}
}
Hi! π
Firstly, thanks for your work on this project!
I was updating angular from
v14
tov17
and thusng2-charts
fromv2.4.2
tov6.0.1
andchartjs
fromv2.9.4
tov3.9.1
on my project and i kept having the following error:I guess
"ng2-charts": "^6.0.1"
does only supportchartjs v4
, but this migration is not yet possible for me. π’To fix my issue, I used patch-package to patch
ng2-charts@6.0.1
.Here is the diff that solved my problem:
This issue body was partially generated by patch-package.