-
Notifications
You must be signed in to change notification settings - Fork 576
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
Compile error on Cannot find module 'chart.js/dist/types/utils' or its corresponding type declarations
with chartjs v3
#1991
Comments
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/[email protected]_@[email protected]_@[email protected]_@[email protected]_@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
to
This change is needed to support typescript-eslint compatible with eslint 9 typescript-eslint/typescript-eslint#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"]
}
}
} |
This is what fixed it for me, I noticed that in my version the path has changed, In the tsconfig.json: "compilerOptions": {
"paths": {
"chart.js/dist/types/utils": ["node_modules/chart.js/types/utils"]
}
} |
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
[email protected]
.Here is the diff that solved my problem:
This issue body was partially generated by patch-package.
The text was updated successfully, but these errors were encountered: