question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dynamically changed Handles cause a break

See original GitHub issue

Hey! First off let me say thanks for creating this awesome package!

I have different NodeTypes that have different amount of <Handles/> on them. There is one component in particular that you make some selections, and based off the selections you make, it changes the elements type. The re-rendering happens and everything looks as it should, but when you select a Handle, it errors out.

I’ve been able to trace it to:

  1. The Node originally renders with 0 Handles.
  2. Make sidebar selections.
  3. Node changes type to where it now has 2 Handles.
  4. Those handles can no longer be connected and error out.

The error I receive is:

ReactFlow.esm.js:7195 Uncaught TypeError: Cannot read property '0' of null
    at ConnectionLine (ReactFlow.esm.js:7195)
    at renderWithHooks (react-dom.development.js:14826)
    at updateFunctionComponent (react-dom.development.js:17059)
    at beginWork (react-dom.development.js:18644)
    at HTMLUnknownElement.callCallback (react-dom.development.js:189)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:238)
    at invokeGuardedCallback (react-dom.development.js:293)
    at beginWork$1 (react-dom.development.js:23235)
    at performUnitOfWork (react-dom.development.js:22186)
    at workLoopSync (react-dom.development.js:22162)
    at performSyncWorkOnRoot (react-dom.development.js:21788)
    at react-dom.development.js:11112
    at unstable_runWithPriority (scheduler.development.js:653)
    at runWithPriority$1 (react-dom.development.js:11062)
    at flushSyncCallbackQueueImpl (react-dom.development.js:11107)
    at flushSyncCallbackQueue (react-dom.development.js:11095)
    at flushPendingDiscreteUpdates (react-dom.development.js:21879)
    at flushDiscreteUpdates (react-dom.development.js:21859)
    at flushDiscreteUpdatesIfNeeded (react-dom.development.js:1095)
    at dispatchDiscreteEvent (react-dom.development.js:4168)```

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
underGhostcommented, Oct 5, 2020

Thanks @moklick! Looks like that fixed my issue. Appreciate you getting to it so fast!

1reaction
underGhostcommented, Oct 4, 2020

Thanks so much!

Yea I started to trace it down and it looks like, we querySelectorAll for the Handles only once. If it happened whenever the type changed then it would probably fix it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dynamic array formulas and spilled array behavior
Excel formulas that return a set of values, also known as an array, return these values to neighboring cells. This behavior is called...
Read more >
Dynamic Web Elements in Web Automation | by Adil Qayyum
If you are automating a dynamic website, the scripts will break as soon as the content changes which will cause your test to...
Read more >
How to dynamically handle changes in a JSON object name ...
The code shows a messagebox, if they have changed to an unknown name. Then find the new name add it to the list...
Read more >
Is it possible to render components "dynamically" using Blazor?
It's all very nice and predictable when you can look at the code and see exactly which components are being rendered on any...
Read more >
Finding and fixing the cause of your dynamic link errors
Dynamic Link changed a lot of workflows for a lot of users, and was one of the ... and you will also have...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found