react-diagrams icon indicating copy to clipboard operation
react-diagrams copied to clipboard

"Cannot read property 'x' of undefined" error when use smart-routing

Open stanislav-grin opened this issue 3 years ago • 4 comments

I'm using v6.2.0 and in the process of making some kind of DB schema diagram that users can view, edit, add/modify/delete tables/columns etc. Here is how it looks like:

image

Currently I have a strange issue after I started to use smart-routing for links. Time to time I receive Cannot read property 'x' of undefined error (on screenshot below), sometimes right after render, and sometimes when trying to drag some node. No strong steps to reproduce this behavior (tried to find out it, but no luck). And sometimes I see another error Cannot read property '26' of undefined (or any other number) caused at pathfinding/src/core/Grid.js.Grid.getNodeAt (Grid.js:84).

image

I saw issues with similar problem, but any solution seems can't help me. https://github.com/projectstorm/react-diagrams/issues/433 Here suggestion is to add engine.recalculatePortsVisually(), but there is no such method in current version of library. Also it does not related to dropping nodes from sidebar. https://github.com/projectstorm/react-diagrams/issues/214

stanislav-grin avatar Aug 27 '20 12:08 stanislav-grin

Any update on this issue? I am getting same issue when rendering a PathFindingLink or dragging it.. the moment the link is near or crosses the canvas, it blows up, giving same errors like above.

PS: I am not using smart-routing.

horizon-sk avatar Oct 05 '21 10:10 horizon-sk

I also need a solution to the issue. The same error occurs. The case cannot be reproduced because the error occurs very irregularly. It occurs while moving nodes while the link is connected.

No errors occur when smart routing is not used (when using DefaultLinkModel). The version I use is v6.6.1.

juls-k avatar Feb 21 '22 07:02 juls-k

Hi, Is there any updates on this issue ? I succeed to use smart routing but then i realized that when I move any node to out of the canvas, i got the same error. Then I looked at the react diagrams demo, i moved a node as the same i did on my screen, i got the same error!

image

stuffOZEN avatar Nov 17 '22 19:11 stuffOZEN

We also struggle with this issue and need support. Is there any plan for this bug or workaround at the moment ?

vmergun avatar Nov 17 '22 19:11 vmergun