react-chartjs-2: defaults = _chart["defaults"].defaults is undefined
Hi and greattings, i maked a project in cube.js and afther that a “dashboard-app” of type ‘real time dashboard’ everything is ok until I run the app and response whit that message:
TypeError: _chart.default is undefined
and i could’t advanced afther that.
so i goes to the file
node_modules/react-chartjs-2/es/index.js:644
and I make a log of the variable ‘_chart’ and I see that only exist the field “_chart[“default”]”
so i fix the error whit this:
// I change this:
// var defaults = _chart["default"].defaults;
// For this:
var defaults = _chart["defaults"];
I hope someone can fix this or use that issue for help
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 19
Might be good to put this requirement on 2.9.4 in the readme. Right now, when I come to this repo and try out the library, it is broken out of the box
Using chart.js 2.9.4 does not seem to fix this.
Here are my dependencies:
I have also verified that 2.9.4 is the version installed in my node_modules folder.
Here is my code:
Here is the error:
this problem is from chart.js package just follow below steps for resolve it 1:npm uninstall chart.js 2:npm i chart.js@2.3
@kapso HorizontalBar chart type was removed. Horizontal bar charts can be configured using the new indexAxis option. You can see example here.
1st -> npm uninstall react-chartjs-2 chart.js Then use this command definitely solve your problem
npm install --save react-chartjs-2 chart.js
Unfortunately I could only use it downgrading to chart.js@2.3 then it worked with latest version.