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

Error: "Cannot remove node "2626" because no matching node was found in the Store." #21442

Closed
neerajverma101 opened this issue May 6, 2021 · 26 comments

Comments

@neerajverma101
Copy link

Which website or app were you using when the bug happened?

Please provide a link to the URL of the website (if it is public), a CodeSandbox (https://codesandbox.io/s/new) example that reproduces the bug, or a project on GitHub that we can checkout and run locally.

What were you doing on the website or app when the bug happened?

If possible, please describe how to reproduce this bug on the website or app mentioned above:

Generated information

DevTools version: 4.13.1-93782cfed2

Call stack:
at chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:21499:43
at bridge_Bridge.emit (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:19607:22)
at chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:19767:12
at listener (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/main.js:37788:39)

Component stack:
(none)

GitHub URL search query:
https://api.github.com/search/issues?q=Cannot%20remove%20node%20%20because%20no%20matching%20node%20was%20found%20in%20the%20Store.%20in%3Atitle%20is%3Aissue%20is%3Aopen%20is%3Apublic%20label%3A%22Component%3A%20Developer%20Tools%22%20repo%3Afacebook%2Freact

@bvaughn
Copy link
Contributor

bvaughn commented May 6, 2021

Hi @neerajverma101!

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

@JakeGinnivan
Copy link

FWIW I just got this error and clicked on the link in dev tools to this issue. HMR got a 500 loading the new module from Vite, then renders failed. This happened when i saved a file I was editing with invalid syntax so it couldn't be transformed.

@mastorm
Copy link

mastorm commented May 10, 2021

Funnily, i also run into this issue. I am running vite, just like @JakeGinnivan

@gaearon
Copy link
Collaborator

gaearon commented May 10, 2021

I wonder if it has something to do with Fast Refresh's restore mechanism where it remounts previously failed roots. Maybe those don't get registered somehow?

@bvaughn
Copy link
Contributor

bvaughn commented May 10, 2021

DevTools + Fast Refresh related bug: #21436 (comment)

I'm working on an integration test this morning for stuff like this.

Edit I found at least one failing test: #21436 (comment)

@neerajverma101
Copy link
Author

I'm working on a project based on nextjs and when trying to locate a component through the extension it is getting crashed.

Screenshot from 2021-05-11 12-16-02

@Ostefanini
Copy link

Hello, quick fix for users here: on firefox I've rollbacked to version 4.13.0.
Go to about:addons and remove the extension.
Then click here: https://addons.mozilla.org/firefox/downloads/file/3767928/react_developer_tools-4.13.0-fx.xpi
(it's the direct link to install a specific version from this page: https://addons.mozilla.org/fr/firefox/addon/react-devtools/versions/?utm_content=search&utm_medium=referral&utm_source=addons.mozilla.org )

Add the extension and enjoy debugging again !

@bvaughn
Copy link
Contributor

bvaughn commented May 11, 2021

@Ostefanini @neerajverma101 @mastorm @JakeGinnivan A repro for this bug would be hugely helpful. So far we've gotten reports but no steps to reproduce it (so we can fix it).

Temporarily rolling back the extension is fine to work around the immediate problem but it's not a long term solution 😄

A code example that reproduces the problem (maybe a GitHub repo we could check out and run) would enable us to find and fix the bug and release a patch update.

@pauldewilson
Copy link

Also getting this error on a project I've been working on for two months without issue. I'd like to offer up the repo but it's private with sensitive info. If there's anything I can do to help that isn't divulging the repo then I'm happy to do so. Sorry I can't be of more help, but this is very much a problem for me so keen to help where I can. Thanks.

Screenshot 2021-05-11 182450

@bvaughn
Copy link
Contributor

bvaughn commented May 11, 2021

Unfortunately we really just need a repro. The stack trace is going ot be the same, so screenshots of the error don't give us any additional information. :) Thanks though.

@pauldewilson
Copy link

Unfortunately we really just need a repro. The stack trace is going ot be the same, so screenshots of the error don't give us any additional information. :) Thanks though.

I'll see if I can duplicate the repo and trim the fat then comment back!

@bvaughn
Copy link
Contributor

bvaughn commented May 11, 2021

That would be super helpful

@pauldewilson
Copy link

That would be super helpful

I'm sorry, tried and failed (sort of). Too much of the project depends upon connections that must remain private. FWIW, trying to trim the fat somehow solved the problem. I removed some connections to a Parse server hosted on back4app, and also removed a google maps JS API. Specifically, I get this problem with material UI dialog onClose after opening a dialog on a @react-google-maps/api map. Oddly, it also occurs when navigating away from one of my navbar pages which requires a connection to said B4A server but not other pages that don't. Sorry I can't be of more help.

@amabelleS
Copy link

I also run into this issue, working with react. Its not my repo to share.. so unfortunately I cant. But I got very strange behavior with the state, trying to update after fetching data from the server, it does not reach the state, most of the times... it does when I update the code on VSC on the first render after the save, but then when I refresh the page the data disappears from the state. I added a button, saving mock data in the state ({name: me}), got an additional layer of strangeness.

@bvaughn
Copy link
Contributor

bvaughn commented May 13, 2021

I think #21506 might be one way to fix this issue.

@bvaughn bvaughn self-assigned this May 13, 2021
@bvaughn
Copy link
Contributor

bvaughn commented May 17, 2021

@pauldewilson Would you be interested in trying a build of DevTools (that I can attach to this issue) to see if I've fixed the problem with some changes I've made locally?

@pauldewilson
Copy link

@pauldewilson Would you be interested in trying a build of DevTools (that I can attach to this issue) to see if I've fixed the problem with some changes I've made locally?

Hi @bvaughn yes very happy to try that. Thank you!

@bvaughn
Copy link
Contributor

bvaughn commented May 18, 2021

@pauldewilson Thank you! Here's a build that fixes the problem for me (in unit tests and my local repro).

ReactDevTools.zip

@pauldewilson
Copy link

@pauldewilson Thank you! Here's a build that fixes the problem for me (in unit tests and my local repro).

ReactDevTools.zip

Thanks, tried but still getting the error I'm afraid.
error

@bvaughn
Copy link
Contributor

bvaughn commented May 18, 2021

Thanks for trying it, @pauldewilson. I'm curious, what happens if you dismiss the error dialog?

I guess at this point, I'd really like to get my hands on a repro from you. I could sign an NDA or something if that would be helpful?

bvaughn pushed a commit that referenced this issue May 18, 2021
Works around the corrupted Store state by detecting a broken Fast Refresh remount and forcefully dropping the root and re-mounting the entire tree. This prevents Fibers from getting duplicated in the Store (and in the Components tree). The benefit of this approach is that it doesn't rely on an update or change in behavior to Fast Refresh. (This workaround is pretty dirty, but since it's a DEV-only code path, it's probably okay.)

Note that this change doesn't fix all of the reported issues (see #21442 (comment)) but it does fix some of them.

This commit also slightly refactors the way DevTools assigns and manages unique IDs for Fibers in the backend by removing the indirection of a "primary Fiber" and instead mapping both the primary and alternate.

It also removes the previous cache-on-read behavior of getFiberID and splits the method into three separate functions for different use cases:
* getOrGenerateFiberID – Like the previous function, this method returns an ID or generates and caches a new one if the Fiber hasn't been seen before.
* getFiberIDUnsafe – This function returns an ID if one has already been generated or null if not. (It can be used to e.g. log a message about a Fiber without potentially causing it to leak.)
* getFiberIDThrows – This function returns an ID if one has already been generated or it throws. (It can be used to guarantee expected behavior rather than to silently cause a leak.)
@bvaughn
Copy link
Contributor

bvaughn commented May 18, 2021

This issue is now blocked by not having a repro. #21516 should improve the situation but apparently not fix it entirely. That being said, I'm not sure how to proceed until I get a repro from someone, so I'm tagging all of the folks above who have commented that they're seeing this in hopes that one of them can share something with me.

@bvaughn
Copy link
Contributor

bvaughn commented May 18, 2021

@pauldewilson Can you try this build? 😬

ReactDevTools.zip

@pauldewilson
Copy link

@pauldewilson Can you try this build? 😬

ReactDevTools.zip

Seems to have fixed it! Thank you! And no NDA required after all!

@bvaughn
Copy link
Contributor

bvaughn commented May 19, 2021

Thanks for confirming

@bvaughn
Copy link
Contributor

bvaughn commented May 19, 2021

Should be fixed by #21523.

If you'd like to verify, download this build:
ReactDevTools.zip

And follow these steps to install it:
https://user-images.githubusercontent.com/29597/118749019-b6cda600-b82a-11eb-9449-ef56f41eced5.mp4

@bvaughn bvaughn closed this as completed May 19, 2021
koto pushed a commit to koto/react that referenced this issue Jun 15, 2021
…#21516)

Works around the corrupted Store state by detecting a broken Fast Refresh remount and forcefully dropping the root and re-mounting the entire tree. This prevents Fibers from getting duplicated in the Store (and in the Components tree). The benefit of this approach is that it doesn't rely on an update or change in behavior to Fast Refresh. (This workaround is pretty dirty, but since it's a DEV-only code path, it's probably okay.)

Note that this change doesn't fix all of the reported issues (see facebook#21442 (comment)) but it does fix some of them.

This commit also slightly refactors the way DevTools assigns and manages unique IDs for Fibers in the backend by removing the indirection of a "primary Fiber" and instead mapping both the primary and alternate.

It also removes the previous cache-on-read behavior of getFiberID and splits the method into three separate functions for different use cases:
* getOrGenerateFiberID – Like the previous function, this method returns an ID or generates and caches a new one if the Fiber hasn't been seen before.
* getFiberIDUnsafe – This function returns an ID if one has already been generated or null if not. (It can be used to e.g. log a message about a Fiber without potentially causing it to leak.)
* getFiberIDThrows – This function returns an ID if one has already been generated or it throws. (It can be used to guarantee expected behavior rather than to silently cause a leak.)
@jcubic
Copy link

jcubic commented Mar 19, 2022

I still have this error, on CodeSandbox, when I switch routes.

https://codesandbox.io/s/react-router-remote-table-demo-ojn3wp?file=/src/hooks.ts

But it works when I open the app in a separate window.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment