0

Our react site is based on the argon-pro-dashboard framework. After updating to chart.js@^3.6.0 & react-chartjs-2^4.0.0 we are getting some erros:

TypeError: Cannot read properties of undefined (reading 'prototype')

src/variables/charts.js:28
  25 | // Code from: https://codepen.io/jedtrow/full/ygRYgo
  26 | //
  27 | 
> 28 | Chart.elements.Rectangle.prototype.draw = function () {
  29 |   var ctx = this._chart.ctx;
  30 |   var vm = this._view;
  31 |   var left, right, top, bottom, signX, signY, borderSkipped, radius;

Does anyone encounter this issue? and know if there is a way to fix it? Probably because of the version gap we are experiencing this manner.

1 Answers1

0

This is because it is a major version upgrade in which are a lot of breaking changes. For all of them please read the migration guide. In your case elements.Rectangle doesnt exist anymore. It has been replaced with elements.bar

LeeLenalee
  • 27,463
  • 6
  • 45
  • 69