ankane / chartkick

Create beautiful JavaScript charts with one line of Ruby
https://chartkick.com
MIT License
6.33k stars 565 forks source link

$().size is not a function after upgrading jquery to 3.x #554

Closed barmic12 closed 3 years ago

barmic12 commented 3 years ago

Describe the bug After upgrading jquery to 3.x, an error related to .size function appeared:

Uncaught TypeError: b.size is not a function
    at ha (Chart.bundle.source.js:8925)
    at a (Chart.bundle.source.js:8922)
    at HTMLDocument.ba (Chart.bundle.source.js:8922)
    at mightThrow (Chart.bundle.source.js:1298)
    at process (Chart.bundle.source.js:1366)

I use chartkick with Sprockets:

//= require chartkick
//= require Chart.bundle

Probably it's related to:

$().size is deprecated in 1.8 and removed in 3.0.

Reference: https://api.jquery.com/size/ 1.2k

To reproduce Use:

In application.js:

//= require chartkick
//= require Chart.bundle
ankane commented 3 years ago

Hey @barmic12, I'm not sure how to reproduce. It looks like the error is coming from Chart.js, but as far as I know, Chart.js doesn't depend on jQuery.

ankane commented 3 years ago

Cleaning up issues (no response and doesn't appear to be caused by Chartkick)