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 Bug] Cannot add node "1" because a node with that id is already in the Store. #27185

Open
ansharah-gs opened this issue Aug 3, 2023 · 12 comments
Labels
Component: Developer Tools Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug Type: Bug

Comments

@ansharah-gs
Copy link

Website or app

running react app

Repro steps

i just made a basic portfolio app on react app and suddenly this bug showed up, and i cant seem to access the localhost link in any browser beside Firefox

How often does this bug happen?

Often

DevTools package (automated)

react-devtools-extensions

DevTools version (automated)

4.27.8-2468a8735

Error message (automated)

Cannot add node "1" because a node with that id is already in the Store.

Error call stack (automated)

emit@moz-extension://961fb755-5a59-4c1c-943c-029f7cf6279b/build/main.js:27059:22
bridge_Bridge/this._wallUnlisten<@moz-extension://961fb755-5a59-4c1c-943c-029f7cf6279b/build/main.js:27228:14
listener@moz-extension://961fb755-5a59-4c1c-943c-029f7cf6279b/build/main.js:57497:41

Error component stack (automated)

No response

GitHub query string (automated)

https://api.github.com/search/issues?q=Cannot add node  because a node with that id is already in the Store. in:title is:issue is:open is:public label:"Component: Developer Tools" repo:facebook/react
@SGP57
Copy link

SGP57 commented Aug 24, 2023

I've got this same error.

I've run react-devtools for the first time today and got the error. There was failure in both the command window and the components tab of the chrome react developer tools (not sure about the terminology)

I've terminated the command window react-devtools and the data in the components tab of chrome ... is now working.

I'm running 4.28.0 (7/10/2023)

hoxyq added a commit that referenced this issue Aug 29, 2023
…rt management and service worker lifetime (#27215)

Fixes #27119,
#27185.

Fixed:
- React DevTools now works as expected when user performs in-tab
navigation, previously it was just stuck.


https://github.com/facebook/react/assets/28902667/b11c5f84-7155-47a5-8b5a-7e90baca5347

- When user closes browser DevTools panel, we now do some cleanup to
disconnect ports and emit shutdown event for bridge. This should fix the
issue with registering duplicated fibers with the same id in Store.

Changed:
- We reconnect proxy port once in 25 seconds, in order to [keep service
worker
alive](https://developer.chrome.com/docs/extensions/whatsnew/#m110-sw-idle).
- Instead of unregistering dynamically injected content scripts, wen now
get list of already registered scripts and filter them out from scripts
that we want to inject again, see dynamicallyInjectContentScripts.js.
- Split `main.js` and `background.js` into multiple files.

Tested on Chromium and Firefox browsers.
@mayureshs
Copy link

@hoxyq, when will this be released ? Is there a beta version that can be used until then ?

@hoxyq
Copy link
Contributor

hoxyq commented Aug 31, 2023

@hoxyq, when will this be released ? Is there a beta version that can be used until then ?

Hey, hopefully I will submit the release next week, and then it depends how long it will be reviewed (usually a couple of days). I am currently fixing some stuff related to it and testing internally at Meta, so it is not ready yet to be shipped for everyone.

But if you want to try it out, you can download corresponding artifacts from the CI - https://app.circleci.com/pipelines/github/facebook/react/45858/workflows/05ef139a-6b29-42d5-9608-9f0058272dec/jobs/714315/artifacts

Make sure that you have only 1 React DevTools extension installed and please share any errors that might occur.

@mayureshs
Copy link

mayureshs commented Aug 31, 2023

Thanks for the update. I have installed the version from the CI artifacts. When the page first loads the extension works as expected. But upon going to other pages within the app, I still the error "Uncaught Error: Cannot remove node "4752" because no matching node was found in the Store.". Here are few screenshots that might help.

image
image
image
image

Also getting this error
image

This the errors I get from the manage extensions page
image

@hoxyq
Copy link
Contributor

hoxyq commented Aug 31, 2023

Thanks for the update. I have installed the version from the CI artifacts. When the page first loads the extension works as expected. But upon going to other pages within the app, I still the error "Uncaught Error: Cannot remove node "4752" because no matching node was found in the Store.". Here are few screenshots that might help.

image image image image

Also getting this error image

This the errors I get from the manage extensions page image

I am currently trying to find ways to fix this, thanks! Reopening browser DevTools usually helps to resolve this error.

@hoxyq
Copy link
Contributor

hoxyq commented Sep 12, 2023

Thanks for the update. I have installed the version from the CI artifacts. When the page first loads the extension works as expected. But upon going to other pages within the app, I still the error "Uncaught Error: Cannot remove node "4752" because no matching node was found in the Store.". Here are few screenshots that might help.

image image image image

Also getting this error image

This the errors I get from the manage extensions page image

Hey, I've recently published 4.28.3 internally at Meta, and it seems far more stable. Can you try the same with
https://app.circleci.com/pipelines/github/facebook/react/46032/workflows/ecf8fde9-3c42-4ff3-9c98-dd2974862576/jobs/715524/artifacts?

@mayureshs
Copy link

This version looks much promising. I will report any issues found during testing.

@hoxyq
Copy link
Contributor

hoxyq commented Oct 4, 2023

Hey, the browser extension v4.28.4 has been published today on Chrome's extensions store. This version includes various changes to the content scripts injection logic, which should be more reliable now.

Can anyone try upgrading to v4.28.4 and report if this is still reproducible?

@Friss
Copy link

Friss commented Oct 12, 2023

Just got a notification about this bug (first time I've ever seen it FWIW)

Screenshot 2023-10-11 at 9 09 26 PM Screenshot 2023-10-11 at 9 09 40 PM

@hoxyq
Copy link
Contributor

hoxyq commented Oct 12, 2023

Just got a notification about this bug (first time I've ever seen it FWIW)

Screenshot 2023-10-11 at 9 09 26 PM Screenshot 2023-10-11 at 9 09 40 PM

Thanks for reporting this, did this happened multiple times or just once? Also, can you please share your actions, after which this error was displayed?

@Friss
Copy link

Friss commented Oct 13, 2023

Just the one time.

Before it happened, I was debugging a dev build of an app for work, I was experiencing timeouts attempting to use the element selector from dev tools (the left list of elements loaded but clicking on any element would result in a timeout error on the right). Then I refreshed the page and got this error. (Submitted this report) and then refreshed and haven't seen it again though I also wasn't using it much afterwards.

@devdlabs
Copy link

MS Edge browser installed devtools two times, after removing. one, error gone.

EdisonVan pushed a commit to EdisonVan/react that referenced this issue Apr 15, 2024
…rt management and service worker lifetime (facebook#27215)

Fixes facebook#27119,
facebook#27185.

Fixed:
- React DevTools now works as expected when user performs in-tab
navigation, previously it was just stuck.


https://github.com/facebook/react/assets/28902667/b11c5f84-7155-47a5-8b5a-7e90baca5347

- When user closes browser DevTools panel, we now do some cleanup to
disconnect ports and emit shutdown event for bridge. This should fix the
issue with registering duplicated fibers with the same id in Store.

Changed:
- We reconnect proxy port once in 25 seconds, in order to [keep service
worker
alive](https://developer.chrome.com/docs/extensions/whatsnew/#m110-sw-idle).
- Instead of unregistering dynamically injected content scripts, wen now
get list of already registered scripts and filter them out from scripts
that we want to inject again, see dynamicallyInjectContentScripts.js.
- Split `main.js` and `background.js` into multiple files.

Tested on Chromium and Firefox browsers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Developer Tools Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug Type: Bug
Projects
None yet
Development

No branches or pull requests

6 participants