chartjs / chartjs-adapter-luxon

Luxon adapter for Chart.js
MIT License
33 stars 22 forks source link

Chart display broken after upgrading to Chart.js 4.0.1 and chart-adapter-luxon 1.2.1 #83

Closed guydavis closed 2 years ago

guydavis commented 2 years ago

Hi all, great project! Really appreciate the integration between Chart.js and Luxon. However, I just updated my application to Chart.js 4.0.1 (was 3.9.1) and chartjs-adapter-luxon 1.2.1 (was 1.2.0). Luxon library is same version. Unfortunately, now my charts display is broken and browser console shows:

chart.min.js:13 Uncaught SyntaxError: Cannot use import statement outside a module (at chart.min.js:13:1)
chartjs-adapter-luxon.min.js:7 Uncaught TypeError: Cannot read properties of undefined (reading '_adapters')
    at chartjs-adapter-luxon.min.js:7:582
    at chartjs-adapter-luxon.min.js:7:178
    at chartjs-adapter-luxon.min.js:7:249
(anonymous) @ chartjs-adapter-luxon.min.js:7
(anonymous) @ chartjs-adapter-luxon.min.js:7
(anonymous) @ chartjs-adapter-luxon.min.js:7
chartjs-plugin-datalabels.min.js:7 Uncaught TypeError: Cannot read properties of undefined (reading 'helpers')
    at chartjs-plugin-datalabels.min.js:7:295
    at chartjs-plugin-datalabels.min.js:7:312
(anonymous) @ chartjs-plugin-datalabels.min.js:7
(anonymous) @ chartjs-plugin-datalabels.min.js:7
jquery.min.js:2 jQuery.Deferred exception: Chart is not defined ReferenceError: Chart is not defined
    at HTMLDocument.<anonymous> (http://192.168.1.129:8926/index:1569:15)
    at e (http://192.168.1.129:8926/static/3rd_party/jquery.min.js:2:30038)
    at t (http://192.168.1.129:8926/static/3rd_party/jquery.min.js:2:30340) undefined

Any tips on overcoming this? Should I just rollback to older versions for now?

Thanks, Guy

benmccann commented 2 years ago

you may wish to try again after the new version is released: https://github.com/chartjs/chartjs-adapter-luxon/pull/82

guydavis commented 2 years ago

Thanks for the quick turnaround. That update to version 1.3.0 seems to have removed the original error above.

Now my problem is with chartjs-plugin-datalabels. I think I'm just going to rollback to ChartJS 3.9 in my development branch until the issues with ChartJS' ecosystem get ironed out. Thanks again!