Open donnrri opened 8 years ago
Did you specifically run "npm install chart.js" in your terminal when you installed react-chartjs?
I installed the chart.js, but the problems still exist
Make sure you install npm install chart.js --save
not npm install chartjs --save
I did that myself and got that error, realizing the package was wrong when trying to manually adjust it in the module.
I'm receiving this same error Uncaught TypeError: Cannot read property 'Chart' of undefined
with chart.js@^1.1.1 installed. Any ideas?
same problem here
++ @jhudson8
Same issue. Excluding node_modules from babel-loader fixed it.
module: {
loaders: [
{
test: /\.jsx?$/,
exclude: /(node_modules)/,
loader: 'babel-loader'
}
]
}
+1
+1
I had the same problem, but as @nickstanish suggested in his response, node_modules exclusion in Webpack solved this. Thanks.
Thanks @nickstanish works for me!
In my case was the incorrect version installed 1.1. should be ^2.
UPDATE: The error was quite different Cannot read property 'bar' of undefined
Hi,
I cannot find many details as to why I am getting an error when trying to render a chart using react-chartjs. I'm using react v0.13 and webpack. I use the following code :
var LineChart = require("react-chartjs").Line; var React = require('react');
var LChart = React.createClass({
propTypes: { data: React.PropTypes.object }, render: function() {
} });
module.exports = LChart;
but when I use this component within my app I get the error Cannot read property 'Chart' of undefined line 10 Chart.js . Is this a commonly found error and I am missing the solution somewhere ? Thanks for any comments