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

Fix or silence "cannot find fiber with ID" warnings when hovering #166

Closed
gaearon opened this issue Apr 16, 2019 · 2 comments
Closed

Fix or silence "cannot find fiber with ID" warnings when hovering #166

gaearon opened this issue Apr 16, 2019 · 2 comments
Labels
😎 enhancement New feature or request

Comments

@gaearon
Copy link
Collaborator

gaearon commented Apr 16, 2019

Sometimes I see "cannot find fiber with ID" when hovering over the tree. They are sporadic. I'll need to dig into why they happen. But we also need to look at our usage of warnings to make sure they're either actionable or gated by DEV/DEBUG.

@gaearon gaearon added the 😎 enhancement New feature or request label Apr 16, 2019
@bvaughn
Copy link
Owner

bvaughn commented Apr 16, 2019

I agree this is probably not ideal currently. What are "expected" edge cases and what are legit errors? I've tried to replace legit error cases with throw statements recently, but I understand that it's still not the clearest.

Some (most?) of the the remaining warnings are expected potential edge cases. A little more context...

For example, if an element is selected in the DevTools frontend, then it gets unmounted on the page/backend, we may temporarily see this warning when we query for its inspected props:

function inspectElementRaw(id: number): InspectedElement | null {
let fiber = idToFiberMap.get(id);
if (fiber == null) {
console.warn(`Could not find Fiber with id "${id}"`);
return null;
}

Similarly, since the Store is mutable, it's possible that a node will be removed while a render batch is in progress:

// Handle elements that are removed from the tree while an async render is in progress.
if (element == null) {
console.warn(`<ElementView> Could not find element at index ${index}`);
// This return needs to happen after hooks, since hooks can't be conditional.
return null;
}

@bvaughn
Copy link
Owner

bvaughn commented Aug 19, 2019

This repository is being merged into the main React repo (github.com/facebook/react). As part of this, I am moving all issues to that repository as well and closing them here.

This issue has been relocated to:
facebook/react#16493

@bvaughn bvaughn closed this as completed Aug 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
😎 enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants