Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DevTools Profiler: "getCommitTree(): Unable to reconstruct tree for root "…" and commit …" #18033

Closed
morfioce opened this issue Feb 13, 2020 · 11 comments

Comments

@morfioce
Copy link

Describe what you were doing when the bug occurred:
1.
2.
3.


Please do not remove the text below this line

DevTools version: 4.4.0-f749045a5

Call stack: at N (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:40:154255)
at e.getCommitTree (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:40:157019)
at yl (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:40:320890)
at ei (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:32:58864)
at Mi (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:32:67500)
at yl (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:32:108161)
at kc (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:32:99474)
at wc (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:32:99399)
at fc (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:32:96173)
at chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:32:45937

Component stack: in yl
in div
in div
in div
in vo
in Unknown
in n
in Unknown
in div
in div
in Qi
in Ve
in nn
in Da
in Yc

@bvaughn
Copy link
Contributor

bvaughn commented Feb 15, 2020

It doesn't look like this bug report has enough info for one of us to reproduce it.

Please provide a CodeSandbox (https://codesandbox.io/s/new), a link to a repository on GitHub, or provide a minimal code example that reproduces the problem. Screenshots or videos can also be helpful if they help provide context on how to repro the bug.

Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve

@esvyridov
Copy link

@bvaughn Looks like the issue is still reproducible after a PR which was done in #16412 . I can try to reproduce the steps from #16412 if it'll help somehow.

@bvaughn
Copy link
Contributor

bvaughn commented Feb 17, 2020

@esvyridov Help fixing this would certainly be appreciated.

@esvyridov
Copy link

@bvaughn I'll try to help and fix that issue. Thank you

@esvyridov
Copy link

esvyridov commented Feb 20, 2020

@bvaughn I was able to reproduce the error here https://codesandbox.io/s/getcommittree-gsqzl. There you will see really strange code :) I think this error could happen because of codebase. No steps required just click on "reload and start profiling" and navigate through commit tree. I'll continue try to reproduce the error with more real world code.

Also during my investigation I saw this error "An error was thrown: "Commit tree does not contain fiber 19. This is a bug in React DevTools."" Let me know if I need to create a sandbox for that error too.

getCommitTree.json.zip
fiber.json.zip

@bvaughn
Copy link
Contributor

bvaughn commented Feb 20, 2020

Sweet. Thanks for the update! 😄 Any interest in digging into the underlying DevTools code to see if you can find a fix?

If not, that's okay. Having a more reliable way to reproduce the problem will be helpful to whoever looks into fixing it regardless!

@esvyridov
Copy link

@bvaughn I'll try but it could take time for digging into the code and debugging. Thank you

@bvaughn
Copy link
Contributor

bvaughn commented Feb 20, 2020

Of course 🙇 We're appreciate for anything you're able to do. No worries either way.

@bvaughn bvaughn changed the title Error: "getCommitTree(): Unable to reconstruct tree for root "1" and commit 152" DevTools Profiler: "getCommitTree(): Unable to reconstruct tree for root "…" and commit …" Mar 4, 2020
@jyash97
Copy link
Contributor

jyash97 commented Mar 19, 2020

Hey @bvaughn

I was looking into the same issue and I encountered these bug: An error was thrown: "Cannot read property '2' of null". And digging into the same issue I found we aren't taking into account if operations[commitIndex] exists over this line: https://github.com/facebook/react/blob/master/packages/react-devtools-shared/src/devtools/views/Profiler/CommitTreeBuilder.js#L85.

These results in an error on accessing an index from undefined or null: https://github.com/facebook/react/blob/master/packages/react-devtools-shared/src/devtools/views/Profiler/CommitTreeBuilder.js#L171

Do we want to add a check for this? I am happy to create PR for the same.

Also, another feature/request: Is it possible to reload the Profiler view when there is an error. Currently, we need to reload the whole page. Happy to work on this feature.

@bvaughn
Copy link
Contributor

bvaughn commented Mar 19, 2020

@jyash97 If you're digging into this code and think it would make sense to add a check or something, please feel free to share a PR 😄

I don't have the bandwidth at the moment to dig in and give it much thought, but I didn't want to ignore this comment entirely!

@bvaughn
Copy link
Contributor

bvaughn commented Mar 25, 2020

I landed PR #18378 this morning. It fixes a source of problem that I think might be responsible for this, and some of the other infrequent Profiler errors. I'll release an update to the Chrome/Firefox/Edge stores today.

@bvaughn bvaughn closed this as completed Mar 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants