projectstorm / react-diagrams

a super simple, no-nonsense diagramming library written in react that just works
https://projectstorm.cloud/react-diagrams
MIT License
8.61k stars 1.17k forks source link

Treeview - Uncaught TypeError: Cannot read property 'children' of undefined #695

Open ratnajeetshyamkunwar opened 4 years ago

ratnajeetshyamkunwar commented 4 years ago

Recently, I encountered this error after a fresh yarn install which replaced earlier yarn.lock file with new one in which the material-UI seems to have upgraded a lot of its internal dependencies (I am using "@material-ui/core": "^4.8.3", "@material-ui/icons": "^4.5.1", "@material-ui/lab": "^4.0.0-alpha.39",). It works fine with my earlier yarn.lock file, but I am not able to install anything new because of this.

The error:

TreeView.js:590 Uncaught TypeError: Cannot read property 'children' of undefined at buildVisible (TreeView.js:590) at TreeView.js:601 at commitHookEffectListMount (react-dom.development.js:19607) at commitPassiveHookEffects (react-dom.development.js:19644) at HTMLUnknownElement.callCallback (react-dom.development.js:189) at Object.invokeGuardedCallbackDev (react-dom.development.js:238) at invokeGuardedCallback (react-dom.development.js:291) at flushPassiveEffectsImpl (react-dom.development.js:22708) at unstable_runWithPriority (scheduler.development.js:656) at runWithPriority$1 (react-dom.development.js:11076) at flushPassiveEffects (react-dom.development.js:22676) at performSyncWorkOnRoot (react-dom.development.js:21591) at react-dom.development.js:11130 at unstable_runWithPriority (scheduler.development.js:656) at runWithPriority$1 (react-dom.development.js:11076) at flushSyncCallbackQueueImpl (react-dom.development.js:11125) at workLoop (scheduler.development.js:600) at flushWork (scheduler.development.js:556) at MessagePort.performWorkUntilDeadline (scheduler.development.js:160)

Screenshot 2020-08-07 at 11 57 29 AM
Charlie102m commented 4 years ago

I am having the same behaviour when filtering the list of data passed to the tree view component externally. It is intermittently throwing this error and white screening the app. Did you find a solution to this?

dylanvorster commented 3 years ago

I have bumped all the dependencies but still need to do a release, which might solve this issue

andergabilondo commented 3 years ago

Hello, I'm having exactly the same problem in my project (not react-diagrams). The part of the tree that is updated with redux store works perfectly but not the one that is generated inside my component. Is there any trick I can do to solve this issue in my code? Any help would be appreciated

andergabilondo commented 3 years ago

Hello, I'm having exactly the same problem in my project (not react-diagrams). The part of the tree that is updated with redux store works perfectly but not the one that is generated inside my component. Is there any trick I can do to solve this issue in my code? Any help would be appreciated

Sorry, I know this is not the right place to write this. I wnat just to help someone with this issue. It is related with the nodeId prop, they must be consecutive.