ankane / chartkick

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

Line chart not rendering after upgrade to 4.0.3 #564

Closed culov closed 3 years ago

culov commented 3 years ago

Trying to render a simple line graph, I get an error with the following stack trace. It appears that with the latest updates, library.helpers is now undefined and it's breaking at this line: var gte29 = "math" in library.helpers.

chartkick.js:812 Uncaught TypeError: Cannot use 'in' operator to search for 'math' in undefined
    at createDataTable (chartkick.js:812)
    at defaultExport.renderLineChart (chartkick.js:937)
    at callAdapter (chartkick.js:2092)
    at renderChart (chartkick.js:2070)
    at LineChart.__render (chartkick.js:2391)
    at errorCatcher (chartkick.js:1894)
    at fetchDataSource (chartkick.js:1922)
    at LineChart.Chart (chartkick.js:2253)
    at new LineChart (chartkick.js:2402)
    at <anonymous>:2:3
ankane commented 3 years ago

Hey @culov, it looks like you're using an older version of Chartkick.js (that line was removed in the 4.0 release).

culov commented 3 years ago

Oops, you're exactly right. The old version of chartkick was still lingering in my node_modules directory. Thank you so much!