Uncaught TypeError: Cannot read property 'getItem' of undefined #1566

Closed
scottydelta opened this Issue Jan 30, 2016 · 19 comments

Projects

None yet
@scottydelta

gettting this error on Chromium: 48.0.2564.97 on bar charts when hovered over bars or when clicked on bars. Works perfectly fine on safari. It was working perfectly on Chromium 46.~

Here is the screenshot of the console.

screen shot 2016-01-29 at 6 33 21 pm

@pras2015

Having the same issue in Chrome Version 48.0.2564.97

Works as expected in Firefox 44.0 and IE 11

@vipul-jain

Uncaught TypeError: Cannot read property 'getItem' of undefined.
Works before chrome update.

c3_chart_internal_fn.isWithinBar = function (that) {
var mouse = this.d3.mouse(that), box = that.getBoundingClientRect(),
seg0 = that.pathSegList.getItem(0), seg1 = that.pathSegList.getItem(1),
x = Math.min(seg0.x, seg1.x), y = Math.min(seg0.y, seg1.y),
w = box.width, h = box.height, offset = 2,
sx = x - offset, ex = x + w + offset, sy = y + h + offset, ey = y - offset;
return sx < mouse[0] && mouse[0] < ex && ey < mouse[1] && mouse[1] < sy;
};

@Roywcm
Roywcm commented Feb 2, 2016

Same error here.
Chrome version: 48.0.2564.97

@sole6
sole6 commented Feb 3, 2016

same here with chrome- Version 48.0.2564.97 m
works fine on firefox though

@kjantzer
kjantzer commented Feb 4, 2016

Thanks @Roywcm , that did the trick.

@paulbrab
paulbrab commented Feb 4, 2016

@Roywcm worked for me too. Would be nice to get the library updated with the fix though.

@bt
bt commented Feb 11, 2016

+1, please merge #1564 into master.

@aendrew aendrew added the bug label Feb 18, 2016
@aendrew
Member
aendrew commented Feb 18, 2016

Hi all, apologies for the delay in getting to this (rather critical) issue. I've merged #1564 into the new dev branch, which is where I'll by merging in the current tranch of PRs for the foreseeable future. Once Masayuki is able to review the dev branch, it'll be merged into master.

To use the dev branch in your projects, do the following:

  • Bower:
    bower install c3#dev --save
  • NPM:
    npm install c3#dev --save

Please let me know if you have any issues. Thanks!

@aendrew aendrew closed this Feb 18, 2016
@aendrew aendrew added this to the 0.4.11 milestone Feb 18, 2016
@Paulsky
Paulsky commented Feb 22, 2016

Hi Aendrew,

I installed the dev branch through Bower. But I'm still getting the error 'Cannot read property 'getItem' of undefined'. Can anyone confirm that the dev branch is working in Chrome 48?

@brayann
brayann commented Mar 1, 2016

Works for me, thanks. Question though: can the dev branch be trusted to use in production? If not, any plans of merging this into a new release? @aendrew

@aendrew
Member
aendrew commented Mar 3, 2016

@brayann The dev branch is currently the master branch with a few tested PRs merged in. It's intended to help push forward to 0.4.12 while @masayuki0812 puts the finishing touches on 0.4.11. As such, it's probably not the most stable thing.

From what I understand, @masayuki0812 is planning a new release fairly soon. I don't see any reason why this wouldn't be in it.

@aendrew
Member
aendrew commented Mar 3, 2016

I'm actually going to reopen this issue until the fix is in master so as to increase visibility. It'd be really bad if 0.4.11 went out without this.

@aendrew aendrew reopened this Mar 3, 2016
@xtreemrage

@Paulsky
This works for me with bower (bower -v = 1.7.7)

@roshansachan

I pulled the dev branch and noticed that it was still having the error. I tried using the unminified version of dev branch to dig into the issue but strangely the error was gone. The error comes only when using the c3.min.js and works fine with c3.js .

@vladimirprieto

@roshansachan was right. i downloaded dev branch and try with minified version, didn't work just the c3.js works.

Chrome 49.0.2623.87 (64-bit)

@aendrew
Member
aendrew commented Apr 30, 2016

Anyone having issues with the dev branch, please do the following:

  1. Run npm install to install all the build dependencies.
  2. Run grunt to build all the distributed files.

I haven't been updating the build files in the dev version because it it makes merging changes easier. Please don't use Bower with the dev branch for the moment!

@masayuki0812
Member

This has been merged into master as 0.4.11. Thank you!

@wmfgerrit wmfgerrit pushed a commit to wikimedia/wikimedia-fundraising-dash-src-bower_modules that referenced this issue Dec 1, 2016
@ejegg ejegg Update c3 to 4.11
Get this fixed: c3js/c3#1566

Change-Id: Ie430f8aafcddfd19245d065e455c745e9b7e9c40
293db7e
@wmfgerrit wmfgerrit pushed a commit to wikimedia/wikimedia-fundraising-dash that referenced this issue Dec 1, 2016
@ejegg ejegg Update c3 library to 4.11
Fixes a Chrome click event bug: c3js/c3#1566

Change-Id: If49f59d8e6b39c3535eca5fc10a767797803f2bd
8e0d3cf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment