Describe what you were doing when the bug occurred:
The react profiler tab in the devtools gave this error, I think as I clicked the record icon to stop recording the profile.
DevTools version: 4.5.0-355970aa4
Call stack: at N (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:40:160881)
at j (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:40:160015)
at j (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:40:159939)
at j (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:40:159939)
at j (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:40:159939)
at j (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:40:159939)
at j (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:40:159939)
at j (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:40:159939)
at j (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:40:159939)
at j (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:40:159939)
Component stack: in ec
in div
in div
in div
in So
in Unknown
in n
in Unknown
in div
in div
in rl
in Ze
in fn
in Ga
in _s
Any chance this is reproducible, @byronanderson?
(And if so, any chance you could share steps for us to trigger it?)
Nope, I had tried at the time, and tried again just now, but it won't happen again w/ the same steps.
I _can_ say that the CPU was getting hammered by frequent large react rerenders due to the a redux selector returning a new object without proper memoization, if that tells you anything.
The only reason I even opened the issue was that the issue template was shown to me w/ the crash, so if this minified stack trace means nothing to you, I won't be offended by closing it.
The simplest way to fix this is to bind the function, I suggest that you bind the function in the constructor, like so
class MonthsTable extends Component {
constructor(props, context){
super(props, context);
this.handleChangeOnMonth = this.handleChangeOnMonth.bind(this);
}
handleChangeOnMonth(e){
this.props.setMonth(e.target.id, e.target.value);
}
render(){
return (
I assume this error is in CommitTreeBuilder because it's the only place in Profiler code that calls .concat() that I see:
https://github.com/facebook/react/blob/5aa967b69b255ede89c03dda8cd617b61c492cdb/packages/react-devtools-shared/src/devtools/views/Profiler/CommitTreeBuilder.js#L240-L241
In particular, the problem would happen if getClonedNode failed to find a matching node for the parent:
https://github.com/facebook/react/blob/5aa967b69b255ede89c03dda8cd617b61c492cdb/packages/react-devtools-shared/src/devtools/views/Profiler/CommitTreeBuilder.js#L154-L162
This isn't an expected case, so I'm not sure what went wrong here. Being able to repro this woudl be very helpful.
By the way, yesterday's release (v4.7) fixed several potential Profiler bugs. Maybe it also fixed this one. Were you able to repro this issue before? If so can you try with the latest/current DevTools?
Sample data set from #19137 that reproduces this bug.
profiling-data.06-16-2020.18-42-16.zip
The more interesting thing is to figure out how the data gets corrupted in the first place though which will require a repro.
I encountered the same error and I think I have a repro:
DevTools version: 4.8.2-fed4ae024
@IDrissAitHafid Can you share your repro as a Code Sandbox app with instructions on how to run?
Okay, I'll see if I can do it!
@bvaughn can you see if you can reproduce it using this Code Sandbox app?
What I did was:
Nice repro! Thanks