Replies: 5 comments
-
You are trying to use V3 way of importing instead of V2: V2 docs: https://www.chartjs.org/docs/2.9.4/ Might need to downgrade react or upgrade charts idk which version it depends on |
Beta Was this translation helpful? Give feedback.
-
What is the correct import? |
Beta Was this translation helpful? Give feedback.
-
if i upgrade to latest version, i am getting this error ./node_modules/chart.js/dist/chart.esm.js |
Beta Was this translation helpful? Give feedback.
-
For 2.9.4, you can follow the old docs: https://www.chartjs.org/docs/2.9.4/getting-started/integration.html I'm not sure what that specific error is, but it seems like you need Babel or another transpiler to use the |
Beta Was this translation helpful? Give feedback.
-
Include "react-chartjs-2": "^3.0.0" into your react
Inlcude "react-chartjs-2": "^3.0.0" in your package. json file |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
./node_modules/react-chartjs-2/dist/index.modern.js
Module not found: Can't resolve 'chart.js/auto' in 'C:\Users\win10\Desktop\project\covid-19-tracker\node_modules\react-chartjs-2\dist'
"chart.js": "^2.9.4",
"react-chartjs-2": "^3.0.3",
Beta Was this translation helpful? Give feedback.
All reactions