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

Hermes debugger can't connect in Windows 10/11 #4

Closed
GollyJer opened this issue Feb 23, 2022 · 23 comments
Closed

Hermes debugger can't connect in Windows 10/11 #4

GollyJer opened this issue Feb 23, 2022 · 23 comments
Labels
bug Something isn't working SDK 44 Affects plugin in Expo SDK 44 SDK 45 Affects plugin in Expo SDK 45 SDK 46 Affects plugin in Expo SDK 46 upstream flipper Upstream issue with fbflipper (check linked issues)

Comments

@GollyJer
Copy link

GollyJer commented Feb 23, 2022

Edit By Maintainer: Please see the upstream Hermes + Windows Issue If you are running into this bug, please include your Expo SDK version (which tells us what React Native version you are using) and include your Podfile from running expo prebuild so that we can provide additional information to the Flipper team. ❤️

(Original report below)


I'm curious if anyone has gotten the Hermes plugin to work.

React DevTools works great but I get this when trying to pull up Hermes (which our app is using).
2022-02-23_10h33_31

And this is all that's logged.
2022-02-23_10h33_14

Is the Hermes plugin even expected to work?

Thanks!

@jakobo
Copy link
Owner

jakobo commented Feb 24, 2022

EDIT You can find the current recommended practices here: #4 (comment)


If you're on windows, it looks a lot like facebook/flipper#1520. Can you try launching with your host in localhost mode? expo start --host localhost?

If you're not in Windows, can you pass along the RN version and your plugin config?

@jakobo jakobo added the investigating Ongoing conversation about the issue label Feb 24, 2022
@GollyJer
Copy link
Author

Hi @jakobo. Thanks for the help!

Not sure if I got closer or further away. 😀
Yes, I'm on Windows.
I launched expo start --host localhost with my physical Android phone connected to the computer with USB Debugging enabled.

Flipper now shows the app & phone correctly but none of the plugins enable and I get more items in the log.
image

The RSockets warning particularly sticks out as websockets seems to be most peoples issue in the thread you linked.

@GollyJer
Copy link
Author

GollyJer commented Feb 25, 2022

P.S. - What hardware setup do you use? If you're using Mac and an iPhone I can take the time to switch over knowing it will work.

I recently got a 16' Macbook M1 Pro to play with but keep coming back to my Windows machine because of the OLED display. 😀

I'd love to get Windows debugging working but I'd like get this memory leak in the app debugged even more. 😝

@jakobo
Copy link
Owner

jakobo commented Mar 1, 2022

EDIT You can find the current recommended practices here: #4 (comment)


My current setup is Windows 10 + WSL, with Android Emulator and iOS Device (SDK 44). However, I'm not currently running Hermes. This is most likely an issue with networking to WSL and networking at this point. I did a writeup about the networking woes here: https://codedrift.com/thunked/running-expo-in-windows-subsystem-for-linux-wsl2

The tl;dr of the piece is go get WSLHostPatcher https://github.com/CzBiX/WSLHostPatcher which will allow your WSL instances to listen to the parent host IP. You can then launch with expo start --host 0.0.0.0 to listen on all interfaces.

@gloredo
Copy link

gloredo commented Mar 4, 2022

Same problem here, when using --localhost the only difference is that the following screen appears but the error persists

7553676ea31012a9faebc436df384d873479f9b6

package.json

"expo": "^44.0.6",
"expo-community-flipper": "^44.0.1",
"react-devtools-core": "^4.23.0",
"react-native-flipper": "^0.137.0",

environment

Windows 10 Pro 19043.1526
Flipper Version 0.137.0

@GollyJer
Copy link
Author

GollyJer commented Mar 4, 2022

@gloredo
Yeah, I've given up at this point. I'm stuck with console logs for now.

@jakobo jakobo added bug Something isn't working SDK 44 Affects plugin in Expo SDK 44 and removed investigating Ongoing conversation about the issue labels Mar 8, 2022
@jakobo
Copy link
Owner

jakobo commented Mar 8, 2022

EDIT You can find the current recommended practices here: #4 (comment)


Getting some more bandwidth to dig into what's going on here. Do you mind sharing the Podfile (with redactions if needed) generated in ios/ when you run expo build? All the plugin does is modify the Podfile which shouldn't cause an issue with Hermes.

Specifically, we should see:

  • :hermes_enabled => true which was set by expo with Hermes enabled
  • # Flipper support successfully added via expo config plugin which are lines added by this plugin

If we have those lines, then we should see if v8 can connect to Hermes outside of Flipper. Instructions. If we can connect using Chrome, then it is likely something about our Podfile setup that's needed for WSL compatibility. If we can't connect, then it's very likely a networking issue caused by WSL running in a NAT instead of a proper bridged network.

@GollyJer
Copy link
Author

GollyJer commented Mar 8, 2022

Hey @jakobo. Thanks for the response.
I won't have time to dig into this until the end of the week but just wanted to point out one thing. I'm running in native Windows 11 not WSL. Not sure if @gloredo is the same, but this would at least eliminate local networking between WSL and Windows native as a potential problem.

@jakobo
Copy link
Owner

jakobo commented Mar 8, 2022

EDIT You can find the current recommended practices here: #4 (comment)


That's helpful information! Since all we're doing is modifying the Podfile, I think trying to connect the chrome debugger to hermes will be a good next step as it takes Flipper out of the picture completely and we can figure out if this is a windows networking issue or a Flipper/RN issue.

@obasille
Copy link

Hi, I have the same issue.

I on Win 10 Pro, Android simulator, Expo 44, Flipper client 140.

In Chrome I have this:
image

If I select any of them, it opens the DevTools but I get this error in the console:

DevTools failed to load source map

Something is working though, because if I pause the debugger the application stay frozen until I resume script execution.

@jakobo
Copy link
Owner

jakobo commented Mar 30, 2022

EDIT You can find the current recommended practices here: #4 (comment)


@obasille I believe that's unrelated. The error in console is probably because in Chrome you've got automatic sourcemaps turned on. (Developer Tools => Settings => Sources => (uncheck) Enable JavaScript Sourcemaps. For the thread, how are you starting your expo app? And are you passing --host 0.0.0.0 as an argument?

@obasille
Copy link

Thanks! I'm running with expo run:android

I'm not sure I understand about --host 0.0.0.0, are you talking about starting Chrome with this argument? (it doesn't seem to a valid argument for expo run and expo start).

@jakobo
Copy link
Owner

jakobo commented Apr 1, 2022

Sorry, the --host 0.0.0.0 is a pure metro solution (pulled from my wrong package.json) but stems from the same networking error. Windows isn't always good about forwarding everything along to WSL for the linux-on-windows crowd, and it seems to be equally bad with websockets and IPv4/6. Here's what I'd recommend. (I'll also update previous threads for newcomers to point to this comment)

WSL Users

You need to install and run WSLHostPatcher, as Windows is awful at forwarding everything along to the WSL instance. This app uses the Windows Detours framework to enable WSL listening on 0.0.0.0 (the everything interface). You can also manually forward things with network scripts, but it's a massive headache.

The majority of connection problems related to WSL come from expo (and react-native) binding to the local IP. When using localhost, it's unreachable from windows. When using lan, it binds to the wrong side of the NAT bridge that WSL uses. HostPatcher lets WSL use the system's localhost, allowing --host localhost to work as expected during expo start.

Non WSL Windows Users

There appears to be a few related issues for Flipper in Windows 10 and 11, which I've linked below for visibility.

If we've exhausted these, we should either open or 👍🏻 a related issue in the Flipper repository. I'm also happy to modify the README about potential issues when using Win 10/11.

@jakobo jakobo changed the title Hermes Debugger? Hermes debugger can't connect in Windows 10/11 Apr 1, 2022
@jakobo jakobo added the upstream flipper Upstream issue with fbflipper (check linked issues) label Apr 1, 2022
@obasille
Copy link

obasille commented Apr 4, 2022

Thank you @jakobo!

@itsramiel
Copy link

Thank you @jakobo!

were you able to make it work on windows?

@obasille
Copy link

Nope (without using WSL)

@mitramejia
Copy link

Also not connecting on:

  • Mac
  • SDK 44
  • Hermes enabled
  • iOS simulator

@jakobo
Copy link
Owner

jakobo commented Apr 13, 2022

@mitramejia do you mind sharing your Podfile after running expo prebuild locally? Doing so will help me understand how Flipper is being configured on your system and identify if this is a Flipper issue or an expo plugin issue. Thanks.

@Nantris
Copy link

Nantris commented May 5, 2022

Same issue on Windows 7/SDK 45/Android.

@jakobo
Copy link
Owner

jakobo commented May 9, 2022

@slapbox, as mentioned above, can you share your Podfile after running expo prebuild locally? Right now, we need to figure out if this is a Flipper or plugin issue. Thanks!

edit with SDK 45 out now, I've added an explicit note to the readme about windows + hermes. Advanced thanks to those who also reported it upstream on the fbflipper thread: facebook/flipper#3433

@jakobo jakobo added investigating Ongoing conversation about the issue SDK 45 Affects plugin in Expo SDK 45 labels May 9, 2022
@jakobo jakobo added SDK 46 Affects plugin in Expo SDK 46 and removed investigating Ongoing conversation about the issue labels Aug 22, 2022
@jakobo
Copy link
Owner

jakobo commented Aug 24, 2022

For others in this thread, SDK 46 now has a better way to initialize flipper in the Podfile, and some daring souls have figured out how to launch Flipper so it can find metro (!!!) and find Hermes (!!!x2). #19 for details. I'm going to close this as fixed, but lets open a new issue if in SDK 46 people are having issues w/ the Hermes configuration.

@jakobo jakobo closed this as completed Aug 24, 2022
@jakobo
Copy link
Owner

jakobo commented Oct 1, 2022

Just crediting folks for their hard work on this.

@all-contributors please add @GollyJer for bugs (and thank you for helping work through these issues)

@allcontributors
Copy link
Contributor

@jakobo

I've put up a pull request to add @GollyJer! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working SDK 44 Affects plugin in Expo SDK 44 SDK 45 Affects plugin in Expo SDK 45 SDK 46 Affects plugin in Expo SDK 46 upstream flipper Upstream issue with fbflipper (check linked issues)
Projects
None yet
Development

No branches or pull requests

7 participants