-
Notifications
You must be signed in to change notification settings - Fork 47.2k
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 Bug] Could not inspect element with id "1335" #22099
Comments
Hi! I'm sorry you ran into this problem 😦 Unfortunately, it doesn't look like this issue has enough info for one of us to reproduce it though. This means that it's going to be very hard for us to fix. Please help us by providing a link to a CodeSandbox (https://codesandbox.io/s/new), a repository on GitHub, or 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 |
More specifically, this field is asking for a website we can access. Just saying "a website we're developing for a client" doesn't get us any way to reproduce the issue. |
@bvaughn just noticed the same issue with the following public app: https://omatsuri.app DevTools version 4.15.0-c6f2188ed |
@sskorol Can you repro? I can't (on the website you linked) |
@bvaughn here's a link on video: https://drive.google.com/file/d/1imp0RKqYHDHtWUUX_92RUzNjFMY6mnCF/view?usp=sharing Note that I'm running it on Chrome Version 92.0.4515.131 (Official Build) (x86_64) / BigSur 11.5.1 / DevTools version 4.15.0-c6f2188ed Here are additional settings: |
A video link doesn't help us unfortunately. We need to be able to reproduce the error (so we can inspect the code and see what/why it's breaking). |
You can try pulling their source code and run it locally on the same browser / extension version. As I'm able to reproduce it every time. |
Unfortunately I already spent some time poking around on the page with DevTools, inspecting things, and was unable to reproduce the error. |
@bvaughn I have noticed this happens most often when I'm developing a react app and the app does a hot update because I just updated some code. On production websites it does not happen that often |
@Aniganesh If you can come up with reliable steps to trigger it (even if they include running a dev server and editing files) I'd love to hear. I'd love to fix this bug. |
I think I just accidentally reproduced it with my website. Here are the reproduction steps:
Here is a video of me reproducing the bug and here is the website source code. The "b" component is the "App" component and the website is being deployed on Vercel. Hope this helps. |
Thank you for the repro, @HonbraDev! 🙇🏼 Interestingly, this did not reproduce the error for me when I first tried it. Then I went to record a video showing that it worked and the second time, it did reproduce for me. Enabling When the page loads initially (host component filter enabled):
When component filters are changed, first the old root is dropped:
Then re-added with new (unfiltered) tree:
The interesting part is this:
The root element ("b") is being added from the backend with an id of I think this is actually happening because of an optimization in how the frontend "inspects" an element. When the element is first selected, the backend inspects the props and state. After, the frontend periodically asks the backend to re-inspect. If the element hasn't rendered since it was last inspected, the backend tells the frontend there has been no change. The frontend then returns the same, previously inspected value:
In this case though, the I think the most straight forward way to fix this is to maybe have the backend generate new ids when a root is dropped like this. Need to think it over some and try to catch this case in a unit test first. Edit 1: I think clearing the Fiber-to-id map on the backend when component filters change not be great either because it would cause us to lose any error/warning data associated with a fiber. I think a more narrowly focused fix would be to update this code: react/packages/react-devtools-shared/src/backend/renderer.js Lines 804 to 807 in bd5bf55
To reset mostRecentlyInspectedElement = null; |
I believe #22160 fixes this. |
@bvaughn great news! When do you expect to release a new version? |
Planning a release today. |
Website or app
Web app we are developing for a client.
Repro steps
Open the components tab - no components will display
Close the components tab
Open the components tab again, this time the the components show but the error shows on the right pane.
How often does this bug happen?
Often
DevTools package (automated)
react-devtools-extensions
DevTools version (automated)
4.14.0-d0ec283819
Error message (automated)
Could not inspect element with id "1335"
Error call stack (automated)
No response
Error component stack (automated)
GitHub query string (automated)
The text was updated successfully, but these errors were encountered: