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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hermes Debugger appears to connect but is empty on Flipper 0.55 win in clean RN 0.63.2 project #1520

Closed
evelant opened this issue Sep 8, 2020 · 17 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed React Native Windows Issues specific to running Flipper on Windows

Comments

@evelant
Copy link

evelant commented Sep 8, 2020

馃悰 Bug Report

Hermes Debugger simply does nothing when connected to a clean RN 0.63.2 project with Hermes enabled on windows. Elements, Console, Sources, Network, Application, etc are all empty of normal content. Doctor passes all tests. Remote debugging is off. No other RN apps running. Verified Hermes running. Android SDK is valid and accessible. All other Flipper functions work fine. There are no problems indicated in the Flipper debug logs.

edit: Sometimes the "Debugging connection was closed" window pops up in the Hermes Debugger. It seems it can be dismissed by clicking outside of it. Pushing "Reconnect DevTools" flashes the window as if refreshing but has no effect.
image

image
image

Debug logs:

(electron) crashReporter.start is deprecated in the renderer process. Call it from the main process instead. 
Secure server started on port 8088 server 
Certificate server started on port 8089 server 
Device connected: TestCleanRNAndroidErrors#Android#sdk_gphone_x86_64_arm64 - 11 - API 30#emulator-5554 server 
{id: 0, method: "getPlugins", params: undefined}
"message:call" 
Device client initialised: TestCleanRNAndroidErrors#Android#sdk_gphone_x86_64_arm64 - 11 - API 30#emulator-5554. Supported plugins: CrashReporter, Databases, Fresco, Inspector, Network, Preferences, React server 

To Reproduce

  1. npx react-native init TestApp
  2. set enableHermes: true in build.gradle
  3. yarn react-native run-android
  4. Observe that there is no content in the hermes debugger tab of Flipper and no relevant content in Flipper debug logs indicating any sort of issue.

Environment

  • Android API 30 on Android Studio emulator x86_64 google_apis
  • React Native 0.63.2 (fresh project, only change is enableHermes: true)
  • Flipper 0.55.0
  • Windows 10 insider preview build 20206.rs_prerelease_200828-1431
@nikoant
Copy link
Contributor

nikoant commented Sep 8, 2020

I've reproduced the same issue on my Windows 10 machine. I'm wondering wether Hermes debugger works for someone on Win 10?

@nikoant nikoant added Windows Issues specific to running Flipper on Windows React Native labels Sep 8, 2020
@cklinx
Copy link

cklinx commented Sep 21, 2020

Same problem here

@petr7555
Copy link

petr7555 commented Nov 1, 2020

Same problem for me

@chenop
Copy link

chenop commented Dec 8, 2020

RN 0.63.3
IOS
Nothin in Hermes tab as well.

I think Javascript debugging is not quite working with Flipper & Hermes which make this tool useless for me - I mean: debugging, breakpoints, variables is the basic.
Please correct me if I'm wrong and there is a way to debug.

@alexfov
Copy link

alexfov commented Jan 12, 2021

Same issue. Are there any solutions?

@nishan-wtv
Copy link

Having the same issue. I am unable to run on my windows machine. In ios, it works well.

@batuhansahan
Copy link

Is there a solution yet ?

@oraci
Copy link

oraci commented Apr 4, 2021

Same problem for me.

@mweststrate mweststrate added good first issue Good for newcomers help wanted Extra attention is needed labels Apr 6, 2021
@mweststrate
Copy link
Contributor

Would be great if someone with a windows machine at hand would be interested in taking a closer look at this, our wrapper is pretty thin (plugin source), so it would be great if someone could investigate a bit deeper and check if...

  1. Stand alone debugging does work: https://reactnative.dev/docs/hermes#debugging-js-on-hermes-using-google-chromes-devtools
  2. If there are any errors in the Flipper log / Flipper devtools
  3. navigating to http://localhost:8081 lists the correct debugging targets

@pranaydutta89
Copy link

same problem

@patrickgalbraith
Copy link

patrickgalbraith commented Apr 14, 2021

Same issue here.

localhost:8081/json shows the following:

image

Flipper shows error connecting to websocket. I wonder if it is because of the IPV6 webSocketDebuggerUrl.

Workaround

I fixed it by starting metro with react-native start --host 0.0.0.0. After that webSocketDebuggerUrl is ws://localhost:8081/inspector/debug?device=0&page=2.

For an older app I needed to run with react-native start --host localhost.

Breakpoints don't seem to trigger though.

@patrickgalbraith
Copy link

@mweststrate Looks like this is an issue in metro. I've opened facebook/metro#662 which should hopefully fix this by providing a valid IPV6 localhost websocket url.

I had a look at the chrome developer tools source and how it initialises the connection and it is done by creating a new WebSocket(...) and passing the webSocketDebuggerUrl (which makes sense).

As you can see ws://[::] is not a valid url:

image

facebook-github-bot pushed a commit to facebook/metro that referenced this issue Jun 24, 2021
Summary:
**Summary**

For IPV4 the webSocketDebuggerUrl defaults to `ws://localhost:8081` but for IPV6 this defaults to `ws://[::]:8081`. This causes issues since `ws://[::]` is not a valid websocket URL, I am guessing it should be `ws:[::1]` which is the IPV6 equivalent.

**Test plan**

The webSocketDebuggerUrl should be `ws:[::1]` rather than `ws://[::]`.

This is related to this issue in Flipper facebook/flipper#1520.

Pull Request resolved: #662

Reviewed By: GijsWeterings

Differential Revision: D29210395

Pulled By: motiz88

fbshipit-source-id: 1522265f786765156aa650c704ad5d2c0605ca24
@ghasemikasra39
Copy link

same problem on 0.64.2

@eltonea
Copy link

eltonea commented Jul 28, 2021

Working in 0.98.0 starting bundle manually with the command bellow:
react-native start --host localhost

@jamesdmurphy51
Copy link

jamesdmurphy51 commented Feb 28, 2022

Same issue for me
react native version 0.64.0
Tool is useless without ability to set breakpoints

@gloredo
Copy link

gloredo commented Mar 4, 2022

Same issue here, for more info see my post on expo forum

@mweststrate
Copy link
Contributor

mweststrate commented Mar 5, 2022

Please open new issue with full details. +1's on closed issues without details are inactionable and are only seen by original convo participants.

@facebook facebook locked and limited conversation to collaborators Mar 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Good for newcomers help wanted Extra attention is needed React Native Windows Issues specific to running Flipper on Windows
Projects
None yet
Development

No branches or pull requests