question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

./node_modules/react-chartjs-2/dist/index.modern.js - Can't resolve 'chart.js/auto'

See original GitHub issue

Hi, i was previously using the @reactchartjs/react-chart.js package and I just switched to ‘react-chartjs-2’ since it’s now deprecated. Just installed the below: “chart.js”: “^2.9.4”, “react-chartjs-2”: “^3.0.3”,

Now, the mere fact of importing a chart throws the below compiling error due to the absence of ‘chart.js/auto’ import { Radar } from "react-chartjs-2";

Failed to compile. ./node_modules/react-chartjs-2/dist/index.modern.js Module not found: Can’t resolve ‘chart.js/auto’

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:9
  • Comments:6

github_iconTop GitHub Comments

1reaction
aquashashcommented, May 12, 2021

I was getting the same error and was able to resolve by installing chart.js 3.0.0 version. But now getting below error

Module parse failed: ……/chart.js/dist/chart.esm.js Unexpected token (6554:12) You may need an appropriate loader to handle this file type. if (intermediateIndex1 !== startIndex && intermediateIndex1 !== lastIndex) { decimated.push({ …data[intermediateIndex1], x: avgX, });

0reactions
szalonnacommented, Mar 25, 2022

But the readme says this lib supports Chart.js v2. So is it or not?

Read more comments on GitHub >

github_iconTop Results From Across the Web

2 - Stack Overflow
Can't resolve 'chart.js/auto' ; React from ; import { Bar } ; "react-chartjs-2"; function ; ) { const ; "1", "2" ...
Read more >
This issue was moved to a discussion. - GitHub
node_modules/react-chartjs-2/dist/index.modern.js Module not found: Can't resolve ... Module not found: Can't resolve 'chart.js/auto #9397.
Read more >
Integration | Chart.js
Chart.js can be integrated with plain JavaScript or with different module loaders. The examples below show how to load Chart.js in different ...
Read more >
Webpack Error "Can't resolve chart.js&#38
p>I'm getting Can't resolve chart.js when including mdbpro in my webpack config.</p> <p>This is the line in the webpack.config: import 'mdbootstrap-pro' ...
Read more >
How To Use Chart.js in Angular with ng2-charts - DigitalOcean
Together, these libraries provide you with the power to present data in a way that is modern and dynamic. If you'd like to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found