DevTools crashes (`levelChildren` is undefined) when selecting a component in Flamegraph view
See original GitHub issueDo you want to request a feature or report a bug? Bug
What is the current behavior?
React DevTools crashes in the code below because levelChildren
is undefined
.
callstack is:
backend.js:formatted:6593 Uncaught TypeError: Cannot read property 'push' of undefined
at S (backend.js:formatted:6593)
at _ (backend.js:formatted:6638)
at inspectHooksOfFiber (backend.js:formatted:6682)
at rt (backend.js:formatted:2372)
at Object.inspectElement (backend.js:formatted:2753)
at t.<anonymous> (backend.js:formatted:3484)
at t.r.emit (backend.js:formatted:978)
at backend.js:formatted:7407
at t (backend.js:formatted:4954)
I haven’t been able to reproduce this yet outside my app, but here’s the steps that trigger the crash in my app:
- open dev tools
- start profiling
- stop profiling
- select the CalendarMiddle component in the Flamegraph view
- crash!
What is the expected behavior? no crash
Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React? I’m running:
- React 16.12
- RDT 4.2.1 (11/27/2019) revision 3816ae7c3
- Chrome 79.0.3945.88 (Official Build) (64-bit)
- MacOS Catalina 10.15.2 (19C57)
I’ve never seen this crash before today. Interestingly, the crash only happens when I select some components in the flamegraph, but doesn’t happen when I select other components. I haven’t figured out the pattern yet of which components will trigger a crash.
I know that this repro isn’t particularly actionable at this point, but I’m hoping that someone who knows the RDT code better than I do might have an idea about why this might be happening.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:18 (3 by maintainers)
Thanks for the repro info.
Perhaps! I think this is a pretty unique situation though. Hot-patching React APIs is not something we encourage because it can break things (like DevTools). It’s hard to write code that can withstand parts of it being overridden in unexpected ways 😄I’ll keep this in mind and reevaluate if it comes up again though!
Thanks for the follow up @justingrant and the quick fix @vzaidman! I’m going to close this issue because I don’t think DevTools needs to make any changes at the moment in response to this issue.
fixed on version 3.5 of
@welldone-software/why-did-you-render