React-chartjs-2: Warning: Failed prop type: Cannot read property 'line' of undefined

Created on 3 Aug 2018  Â·  9Comments  Â·  Source: reactchartjs/react-chartjs-2

Attempting to use this library with no luck. When I add the following code to one of my components...

import { Line as LineChart } from 'react-chartjs-2'

render() {
<LineChart data={data} />
)

I get this error message:

Warning: Failed prop type: Cannot read property 'line' of undefined

Has anyone come across this and figured out a solution?

I'm using:

        "chart.js": "^2.7.2",
        "react-chartjs-2": "^2.7.4",

Most helpful comment

I am using following version from both lib

"chart.js": "^2.6.0",
"react-chartjs-2": "^2.7.4",

All 9 comments

Hello @nathanburgess have you got this sorted? I am having similar issue. Thanks

@sameerjain I didn’t mess with it too much. The trouble of fixing it wasn’t worth it. Instead I went with ChartKick for now, which works with no problems.

Restarting node service fixed this for me, may be module doesn't compiled
well because I installed it while npm start was running. All good now.
Cheers

Keep it positive !!
Warm Regards,
Sameer Jain
+91-98281-23519
+91-98281-23510

On Mon, Aug 13, 2018 at 8:56 PM, Nathan Burgess notifications@github.com
wrote:

@sameerjain https://github.com/sameerjain I didn’t mess with it too
much. The trouble of fixing it wasn’t worth it. Instead I went with
ChartKick for now, which works with no problems.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/jerairrest/react-chartjs-2/issues/318#issuecomment-412558165,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACS3bHrTElL_bU_KoanEv68XzBCSzUi-ks5uQZqtgaJpZM4VtLdP
.

That didn’t work for me. I even tried deleting node_modules and clearing the cache, forcing everything to redownload and rebuild.

Thanks,
Nathan Burgess
On Aug 13, 2018, 08:39 -0700, AugustLeo notifications@github.com, wrote:

Restarting node service fixed this for me, may be module doesn't compiled
well because I installed it while npm start was running. All good now.
Cheers

Keep it positive !!
Warm Regards,
Sameer Jain
+91-98281-23519
+91-98281-23510

On Mon, Aug 13, 2018 at 8:56 PM, Nathan Burgess notifications@github.com
wrote:

@sameerjain https://github.com/sameerjain I didn’t mess with it too
much. The trouble of fixing it wasn’t worth it. Instead I went with
ChartKick for now, which works with no problems.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/jerairrest/react-chartjs-2/issues/318#issuecomment-412558165,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACS3bHrTElL_bU_KoanEv68XzBCSzUi-ks5uQZqtgaJpZM4VtLdP
.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

I am using following version from both lib

"chart.js": "^2.6.0",
"react-chartjs-2": "^2.7.4",

image
After spending half a day trying to get this to work in a new watered down react app, I'm giving up

I had the same problem which I fixed updating the chart.js dependency.
v2.3.7 is the current version by now.

run npm install [email protected] --save

I too am having this problem, please help!

Please create new issues if you are still experiencing issues with the latest versions of both libraries. Include a sandbox example if possible.

Closing

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cbroberg picture cbroberg  Â·  5Comments

jbbae picture jbbae  Â·  5Comments

davidcalhoun picture davidcalhoun  Â·  5Comments

alexchoiweb picture alexchoiweb  Â·  3Comments

RamonBeast picture RamonBeast  Â·  4Comments