jhen0409 / react-native-debugger

The standalone app based on official debugger of React Native, and includes React Inspector / Redux DevTools
MIT License
10.36k stars 809 forks source link

react-devtools: upgrade to version 2 of bridge protocol #709

Closed mfulton26 closed 2 years ago

mfulton26 commented 2 years ago

React Native Debugger app version: 0.12.1 React Native version: 0.69.1 Platform: any Is real device of platform: platform Operating System: macOS

Unsupported DevTools backend version

You are running react-devtools version 4.14.0-d0ec283819.

This requires bridge protocol version 1. However the current backend version uses bridge protocol version 2.

To fix this, upgrade the DevTools NPM package:

npm i -g react-devtools@^4.22.0

Or click here for more information.

image
iwoplaza commented 2 years ago

Same exact things happens to me. None of the recommended fixes from the click here section work either.

pavelgorbach commented 2 years ago

@mfulton26 , could you check if it works for you?

  1. remove node modules rm -rf node_modules
  2. add resolutions to your package.json (only works with yarn)

    "resolutions": {
    "react-devtools-core": "4.14.0"
    }
    1. install dependencies yarn install ~or npm install~

    UPD: do these steps inside your project folder

mfulton26 commented 2 years ago

I installed react-native-debugger using the installer from the releases page.

mfulton26 commented 2 years ago

I think we just need a new maintenance release of this tool with dependencies upgraded and we'll be set. I suspect/hope this will be an easy fix.

pavelgorbach commented 2 years ago

Yes, but if you want to debug some of your react-native projects right now, just try to add resolutions to the package.json of the project you are going to run.

mfulton26 commented 2 years ago

I see, yeah, that might work. I can try that the next time I need to use this tool. For me the tool appears to mostly work fine. (Some issues with not recognizing the GraphQL requests ending on their own; not sure if that is related to this or not.)

Thanks. I'll try the workaround at some point.

mfulton26 commented 2 years ago

Confirmed. I get no "Unsupported DevTools backend version" error with the resolutions addition in my React Native app.

This workaround seems fine for now but eventually I'd like to see another react-native-debugger release which uses the new react-devtools-core version.

Is that an option? I see that most of the commits lately are from dependabot and the last release was almost a year ago.

ivanmercedes commented 2 years ago

I fix this problem as follows

Enter the resources folder of my React Native Debugger installation

in my case I have it on disk D:

cd D://rndebugger/resources
npx asar extract unpacked/ app.asar
cd unpacked/
npm install react-devtools-core@latest
cd..
npx asar pack unpacked/ app.asar
rm -r unpacked

and that's it!

steenhansen commented 2 years ago

Using React Native Debugger 0.12.1 (github.com/jhen409) on Windows

Did NOT "npm i -g react-devtools@^4.22.0"

npm list -g +-- corepack@0.10.0 +-- eas-cli@0.57.0 +-- expo-cli@6.0.1 +-- npm@8.11.0 `-- yarn@1.22.19

package.json (note "react-native/react-devtools-core" NOT "react-devtools-core") "resolutions": { "react-native/react-devtools-core": "4.14.0" }, "dependencies": { "@react-navigation/native": "^6.0.11", "expo": "~45.0.0", "expo-status-bar": "~1.3.0", "react": "17.0.2", "react-dom": "17.0.2", "react-native": "0.68.2", "react-redux": "^8.0.2", "redux": "^4.2.0" },

  1. delete node_modules
  2. "yarn install" as "npm install" does not work
  3. celebrate
mfulton26 commented 2 years ago

Fixed via #706.