react icon indicating copy to clipboard operation
react copied to clipboard

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

Open edapess opened this issue 3 years ago • 7 comments

Website or app

https://github.com/edavetisyan/Recipes

Repro steps

running react-native debugger

How often does this bug happen?

Every time

DevTools package (automated)

react-devtools-core

DevTools version (automated)

4.14.0-d0ec283819

Error message (automated)

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

Error call stack (automated)

at /usr/lib/react-native-debugger/node_modules/react-devtools-core/dist/standalone.js:48:140545
    at c.emit (/usr/lib/react-native-debugger/node_modules/react-devtools-core/dist/standalone.js:48:89515)
    at /usr/lib/react-native-debugger/node_modules/react-devtools-core/dist/standalone.js:48:90986
    at /usr/lib/react-native-debugger/node_modules/react-devtools-core/dist/standalone.js:48:347787
    at Array.forEach (<anonymous>)
    at S.Gc.e.onmessage (/usr/lib/react-native-debugger/node_modules/react-devtools-core/dist/standalone.js:48:347771)
    at S.n (/usr/lib/react-native-debugger/node_modules/react-devtools-core/dist/standalone.js:40:3009)
    at S.emit (events.js:315:20)
    at e.exports.P (/usr/lib/react-native-debugger/node_modules/react-devtools-core/dist/standalone.js:8:9318)
    at e.exports.emit (events.js:315:20)
    at e.exports.dataMessage (/usr/lib/react-native-debugger/node_modules/react-devtools-core/dist/standalone.js:8:15409)
    at e.exports.getData (/usr/lib/react-native-debugger/node_modules/react-devtools-core/dist/standalone.js:8:14651)
    at e.exports.startLoop (/usr/lib/react-native-debugger/node_modules/react-devtools-core/dist/standalone.js:8:12066)
    at e.exports._write (/usr/lib/react-native-debugger/node_modules/react-devtools-core/dist/standalone.js:8:11421)
    at doWrite (_stream_writable.js:403:12)
    at writeOrBuffer (_stream_writable.js:387:5)

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

edapess avatar Apr 25 '22 19:04 edapess

@edavetisyan I was having the same issue and it turns out I had two instances of React Dev Tools running concurrently.

What I think happened is that when I turned on Sync in Edge, it had installed a second instance of Dev Tools. Notice I have 'components' and 'profiler' showing up twice here. Removing one fixed it for me. image

rileyhemp avatar May 02 '22 17:05 rileyhemp

Hey! It seems like you might be having a DevTools version mismatch. The DevTools version in your react native app seems to be v4.14.0, but your have a local react-devtools dependency that's v4.23.0. Could you check to make sure the react-devtools-core version that react-native is using matches the react-devtools version?

lunaruan avatar May 04 '22 21:05 lunaruan

"dependencies": { "expo": "~45.0.0", "expo-status-bar": "~1.3.0", "react": "17.0.2", "react-dom": "17.0.2", "react-native": "0.68.1", "react-native-web": "0.17.7" }, "devDependencies": { "@babel/core": "^7.12.9" },

Attached above is my fresh install expo project, it have the same error

beng970804 avatar May 07 '22 17:05 beng970804

Fixed this by adding

"resolutions": { "react-devtools-core": "4.14.0" },

to package.json. And also I installed [email protected] using yarn. Make sure the version of react-devtools-core is the same as that in react native debugger (or whatever you're using to run react devtools)

eeshankeni avatar May 12 '22 22:05 eeshankeni

"dependencies": { "expo": "~45.0.0", "expo-status-bar": "~1.3.0", "react": "17.0.2", "react-dom": "17.0.2", "react-native": "0.68.1", "react-native-web": "0.17.7" }, "devDependencies": { "@babel/core": "^7.12.9" },

Attached above is my fresh install expo project, it have the same error

Same here.

{
  "name": "app.savy.maxdoingmax",
  "version": "1.0.0",
  "scripts": {
    "start": "expo start --dev-client",
    "android": "expo run:android",
    "ios": "expo run:ios",
    "web": "expo start --web",
    "eject": "expo eject"
  },
  "dependencies": {
    "expo": "~44.0.0",
    "expo-status-bar": "~1.2.0",
    "react": "17.0.1",
    "react-dom": "17.0.1",
    "react-native": "0.64.3",
    "react-native-web": "0.17.1",
    "expo-splash-screen": "~0.14.1"
  },
  "devDependencies": {
    "@babel/core": "^7.12.9",
    "@types/react": "~17.0.21",
    "@types/react-native": "~0.64.12",
    "typescript": "~4.3.5"
  },
  "private": true
}

maximveksler avatar May 15 '22 20:05 maximveksler

Possible Solution suggestion [TESTING NOW]

Solution worked!

  1. Add to package.json
  "resolutions": {
    "react-devtools-core": "4.14.0"
  }
  1. Delete rm -rf node_modules/ && rm package-lock.json
  2. yarn install

maximveksler avatar May 15 '22 20:05 maximveksler

Removing the Tool from chrome and reinstalling it also fixes this.

realadityayadav avatar Sep 13 '22 05:09 realadityayadav

Removing the Tool from chrome and reinstalling it also fixes this.

same

edapess avatar Sep 28 '22 08:09 edapess