Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upEdgesHandler._addMissingEdges Cannot read property 'forEach' of null #3562
Comments
wimrijnders
added
Network
Problem
labels
Oct 12, 2017
This comment has been minimized.
This comment has been minimized.
Aaaand the first issue for release No, that's not supposed to happen. The data structure is exactly the same as previous version. But this means that there is no DataSet instance for edges defined....is it remotely possible that you do not pass any edge data in? In any case, this will need a fix. |
wimrijnders
closed this
Oct 12, 2017
wimrijnders
reopened this
Oct 12, 2017
This comment has been minimized.
This comment has been minimized.
Oops sorry wrong button. |
This comment has been minimized.
This comment has been minimized.
I'm trying to reproduce this through the standard API without much success. Could you give me some example code that shows this problem? |
wimrijnders
added
the
waiting for answer/improvement
label
Oct 13, 2017
This comment has been minimized.
This comment has been minimized.
will do. |
This comment has been minimized.
This comment has been minimized.
Tracked it down. (Well how to cause it anyways.....) Here's an example using the Getting Started Code The problem appears to be related to setting an options field.
triggers the bug, but the weird thing is that it doesn't matter what the value is
also triggers the bug Whereas
Does not. |
wimrijnders
removed
the
waiting for answer/improvement
label
Oct 13, 2017
This comment has been minimized.
This comment has been minimized.
OK, got it. Can reproduce. Thanks for your sleuthing! |
This comment has been minimized.
This comment has been minimized.
That's a nice interplay of internal 'features'. The options get handled before the data and All this can be solved with a strategically placed test on |
wimrijnders
added
Confirmed Bug
and removed
Problem
labels
Oct 13, 2017
This comment has been minimized.
This comment has been minimized.
Yep edges.physics triggers it as well. :-) |
This comment has been minimized.
This comment has been minimized.
Yay! One for the collection. |
This comment has been minimized.
This comment has been minimized.
Was introduced in this version; had to check. We're planning a quick release in 2 weeks time precisely for this kind of |
This comment has been minimized.
This comment has been minimized.
This is where the vis/lib/network/modules/NodesHandler.js Lines 207 to 209 in c56fa19 Let's try |
This comment has been minimized.
This comment has been minimized.
Best thing to do is to block handling of |
added a commit
to wimrijnders/vis
that referenced
this issue
Oct 13, 2017
wimrijnders
referenced this issue
Oct 13, 2017
Merged
Network: Prevent crash when dataChanged is triggered during initialization #3568
This comment has been minimized.
This comment has been minimized.
Wrt to your comment on the PR: it doesn't matter what you fill in for |
This comment has been minimized.
This comment has been minimized.
yeah sorry I deleted it as soon as I wrote it. doh! |
This comment has been minimized.
This comment has been minimized.
No worries. Here, have a beer (icon): |
added a commit
that referenced
this issue
Oct 13, 2017
wimrijnders
added
the
Fixed awaiting release
label
Oct 13, 2017
This comment has been minimized.
This comment has been minimized.
Sorry about this one, should have known better than skip a null check. |
This comment has been minimized.
This comment has been minimized.
@justinharrell not a problem, shit happens. It wasn't obvious at all that this could happen. In any case, it's shared guilt, since I could have noted it when reviewing. I'm just glad we got this so early (thanks OP), in two weeks time with the next release it'll be history. |
This comment has been minimized.
This comment has been minimized.
dakk
commented
Oct 19, 2017
I'm still getting the error using a DataView instead of using an array or DataSet; the problem is not a null data but a missing forEach on DataView. I expected that DataView inherits forEach from DataSet, but the forEach method is not present on DataView. I think we need to put something like: // copy foreach functionality from DataSet
DataView.prototype.forEach = DataSet.prototype.forEach; here: https://github.com/almende/vis/blob/master/lib/DataView.js#L391 |
This comment has been minimized.
This comment has been minimized.
Oops again, thought I checked and made sure Dataview had forEach. Definitely makes sense to me that it should. |
This comment has been minimized.
This comment has been minimized.
dakk
commented
Oct 22, 2017
Is it necessary a new issue @justinharrell ? This was related to a null reference, while my report is about missing method |
added a commit
to watho/visjs
that referenced
this issue
Dec 22, 2017
This comment has been minimized.
This comment has been minimized.
dhermanns
commented
Jan 26, 2018
Hi! Any idea when the fix will be released? |
This comment has been minimized.
This comment has been minimized.
romak1984
commented
Feb 20, 2018
Any progress with this? |
This comment has been minimized.
This comment has been minimized.
aruljane
commented
Feb 25, 2018
Any progress guys? |
This comment has been minimized.
This comment has been minimized.
aruljane
commented
Feb 25, 2018
•
Guys, I tried a work around to disable physics and it worked, `
` |
This comment has been minimized.
This comment has been minimized.
amarvin
commented
Apr 13, 2018
My workaround is to keep using the older Vis.js version 4.20.1 |
This comment has been minimized.
This comment has been minimized.
burgalon
commented
Jul 31, 2018
Thanks @amarvin |
This comment has been minimized.
This comment has been minimized.
JanTheHun
commented
Aug 29, 2018
•
The bug still exists. @aruljane-s workaround doesn't seem to work for me. Any suggestions? This bug is almost a year old, is it possible to fix it somehow? EDIT: EDIT2: |
Stexxen commentedOct 12, 2017
•
edited
On upgrading from 4.20.1 to 4.21. I'm now seeing this error in the console.

This appears to be caused by #3516 and discussed in #3500
Exception is raised at this line - https://github.com/almende/vis/blob/master/lib/network/modules/EdgesHandler.js#L468
Can someone explain if these changes are meant to cause this error and does it require different data structures now?