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.

Defaults creating error

See original GitHub issue

I’m trying to use the { defaults } provided by your wrapper but when I pass these into a <Bar /> I get all kinds of errors. (I am not yet modifying these defaults)

My Code

import { Bar, defaults } from 'react-chartjs-2';

// component level
<Bar redraw data={this.props.chartData} height={300} options={defaults} />

Error in console

core.controller.js:443 Uncaught TypeError: Cannot set property '_data' of undefined
    at Chart.Controller.update (core.controller.js:443)
    at Chart.Controller.resize (core.controller.js:306)
    at eval (core.controller.js:224)
    at eval (core.helpers.js:982)
update @ core.controller.js:443
resize @ core.controller.js:306
(anonymous) @ core.controller.js:224
(anonymous) @ core.helpers.js:982
scale.radialLinear.js:113 Uncaught (in promise) TypeError: Cannot read property 'callback' of undefined
    at ChartElement.convertTicksToLabels (scale.radialLinear.js:113)
    at ChartElement.update (core.scale.js:94)
    at getMinimumBoxSize (core.layoutService.js:144)
    at Object.helpers.each (core.helpers.js:23)
    at Object.update (core.layoutService.js:155)
    at Chart.Controller.updateLayout (core.controller.js:381)
    at Chart.Controller.initialize (core.controller.js:250)
    at new Chart.Controller (core.controller.js:231)
    at new Chart (core.js:7)
    at ChartComponent.renderChart (index.js:212)

Version Chartjs: v2.4.0

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:40

github_iconTop GitHub Comments

77reactions
orisailescommented, Apr 4, 2021

got the same issue. solve it by change the "chart.js": "^2.9.4", in your package.json then delete node modules folder, then in terminal run npm install .

39reactions
zeykercommented, Apr 3, 2021

I was having the same issue, i fixed it going back to version “chart.js”: “^2.9.4” and keeping “react-chartjs-2”: “^2.11.1” @isailaoctavian

Read more comments on GitHub >

github_iconTop Results From Across the Web

Default Error Handling - Micro Focus
These runtime errors are called exceptions. They indicate that something did not go as expected in a script. They can be generated automatically...
Read more >
How to change the default error message on custom form?
Solved: Can you please let me know how to change this error message on save to a customised one? or just hide ?...
Read more >
Customizing a Default Error Message (Sun Identity Manager ...
The Identity Manager Service Provider's default error messages are located in the IDMXMessages.properties file. You can customize these default error messages ...
Read more >
Error: Creating default object from empty value (laravel)
This is the error: enter image description here. This is My Controller: public function update(Request $request, $id) { $request->validate([ ...
Read more >
MVC - Error Handling - How to create default custom error page
Simple example that shows how to create default error page where user will be redirected if unexpected error happensMore info with ready 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