react-native-debugger icon indicating copy to clipboard operation
react-native-debugger copied to clipboard

waiting for client connection

Open god-zhang opened this issue 2 years ago • 13 comments

It has always been 'waiting for client connection', Why?

I used Expo to create the project and started normally, but I have been unable to connect. used Expo go, run to Android phone

Expo version: 49.0

god-zhang avatar Oct 04 '23 17:10 god-zhang

I followed the instructions on connecting to the React Native Debugger app, but Expo keeps opening Chrome dev tools by default

EmmyAina avatar Oct 09 '23 08:10 EmmyAina

I got the same issuse. when I try to connect the React Native Debugger, it opens a new Devtool by default.

Anisha12311 avatar Oct 10 '23 14:10 Anisha12311

+1 here, tried many combinations and nothing

filipepratalima avatar Oct 11 '23 17:10 filipepratalima

same here

ShiyuCheng2018 avatar Oct 30 '23 23:10 ShiyuCheng2018

I have the same issue. Js engine changed to jsc and nothing. In on expo sdk49.

arminhupka avatar Nov 05 '23 22:11 arminhupka

+1

marlo22 avatar Nov 10 '23 08:11 marlo22

Same here. It's very frustrating.

When I do Device -> Shake, it opens the menu:

There's an option called "Open JS debugger". Which opens a chrome devtools instance and not React Native Debugger. There is no more option "Debug JS remotely". All the docs that I find are outdated in this regard.

At the very bottom of that menu there's a "Open React Native dev menu" option. Then inside this menu there is Open Debugger, and Open React DevTools. None of those options seem to do anything, they both yield an error in the terminal:

info Opening flipper://null/Hermesdebuggerrn?device=React%20Native... error Browser exited with error:, Error: invalid url, missing http/https protocol

This is probably the most confusing and least clear documentations I've seen in my life.

gkpo avatar Nov 20 '23 10:11 gkpo

I was able to get this working in my project following the approach in this package: https://github.com/gusgard/react-native-devsettings. I didn't want to add a new dependency to my application so I instead added this snippet:

import {DevSettings, NativeModules} from 'react-native';

const addDebugMenuItems = async () => {
  const message = {
    stop: '(*) Stop Debugging',
    debug: '(*) Debug JS Remotely',
  };

  DevSettings.addMenuItem(message.debug, () => {
    NativeModules.DevSettings.setIsDebuggingRemotely(true);
  });
  DevSettings.addMenuItem(message.stop, () => {
    NativeModules.DevSettings.setIsDebuggingRemotely(false);
  });
};

export const enableDebugging = async () => {
  setTimeout(addDebugMenuItems, 100);
};

Now I'm calling addDebugMenuItems on startup and clicking "Debug JS Remotely" in the dev menu enables me to use react-native-devtools

AlecR avatar Dec 02 '23 13:12 AlecR

@AlecR did you ever get this working with Expo Go? or only in Dev Build?

I used your code above, and put it in my APP/_layout.tsx file, when using the new expo-router v2 since the project doesn't use a APP.tsx file, it uses a _layout.tsx under an APP directory.

It seems to add a new menu Item in the dev build but not expo go. Was hoping to get something working in expo go, but it seems I may be out of luck.

const addDebugMenuItems = async () => {
  const message = {
    stop: '(*) Stop Debugging',
    debug: '(*) Debug JS Remotely',
  };

  DevSettings.addMenuItem(message.debug, () => {
    NativeModules.DevSettings.setIsDebuggingRemotely(true);
  });
  DevSettings.addMenuItem(message.stop, () => {
    NativeModules.DevSettings.setIsDebuggingRemotely(false);
  });
};

export const enableDebugging = async () => {
  setTimeout(addDebugMenuItems, 100);
};

export default function Layout() {
  
enableDebugging();

return (
<Example>
</Example>
 )
 }

Katerlad avatar Dec 20 '23 22:12 Katerlad

I was able to get this working in my project following the approach in this package: https://github.com/gusgard/react-native-devsettings. I didn't want to add a new dependency to my application so I instead added this snippet:

import {DevSettings, NativeModules} from 'react-native';

const addDebugMenuItems = async () => {
  const message = {
    stop: '(*) Stop Debugging',
    debug: '(*) Debug JS Remotely',
  };

  DevSettings.addMenuItem(message.debug, () => {
    NativeModules.DevSettings.setIsDebuggingRemotely(true);
  });
  DevSettings.addMenuItem(message.stop, () => {
    NativeModules.DevSettings.setIsDebuggingRemotely(false);
  });
};

export const enableDebugging = async () => {
  setTimeout(addDebugMenuItems, 100);
};

Now I'm calling addDebugMenuItems on startup and clicking "Debug JS Remotely" in the dev menu enables me to use react-native-devtools

Installing the package an importing in App.tsx helped me 👍🏽

Tuliany avatar Apr 25 '24 07:04 Tuliany

enableDebugging

Yes, you're right. I tried it that way too, and it works perfectly. However, there's one condition: the project cannot run outside Expo Go; it needs to be run in development builds.

god-zhang avatar Apr 25 '24 08:04 god-zhang

Hi,

I try to connect my app with RNDebugger. I am getting the following error Simulator Screenshot - iPhone 15 Pro Max - 2024-05-10 at 08 54 07

roshanShendre13 avatar May 10 '24 07:05 roshanShendre13

I was able to get this working in my project following the approach in this package: https://github.com/gusgard/react-native-devsettings. I didn't want to add a new dependency to my application so I instead added this snippet:

import {DevSettings, NativeModules} from 'react-native';

const addDebugMenuItems = async () => {
  const message = {
    stop: '(*) Stop Debugging',
    debug: '(*) Debug JS Remotely',
  };

  DevSettings.addMenuItem(message.debug, () => {
    NativeModules.DevSettings.setIsDebuggingRemotely(true);
  });
  DevSettings.addMenuItem(message.stop, () => {
    NativeModules.DevSettings.setIsDebuggingRemotely(false);
  });
};

export const enableDebugging = async () => {
  setTimeout(addDebugMenuItems, 100);
};

Now I'm calling addDebugMenuItems on startup and clicking "Debug JS Remotely" in the dev menu enables me to use react-native-devtools

useful

yuxuan-ctrl avatar Jul 24 '24 02:07 yuxuan-ctrl