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

Can't connect to developer's tools from real device (IOS) #712

Open
Natteke opened this issue Mar 19, 2020 · 9 comments
Open

Can't connect to developer's tools from real device (IOS) #712

Natteke opened this issue Mar 19, 2020 · 9 comments

Comments

@Natteke
Copy link

Natteke commented Mar 19, 2020

Environment

RN 61.5
Haul 0.17.0

Looks like by default device trying to connect to localhost:8081/debugger-proxy,
but the haul's server respond is like:
{"statusCode":404,"error":"Not Found","message":"File /debugger-proxy not found"}

Also real device connects fine if i use metro bundler instead.

i even thought i could bundle js by haul, and give the output to metro, but i dont manage to configure metro for that :D

Can you suggest something to connect real device to JS debugger/console?

Thanks!

@Natteke Natteke changed the title Cant connect to developer's tools from real device (IOS) Can't connect to developer's tools from real device (IOS) Mar 19, 2020
@Natteke
Copy link
Author

Natteke commented Apr 22, 2020

Android works only after "adb -s reverse tcp:8081 tcp:8081"
Maybe this is the case

Is there any workaraunds or something i could do to connect real device to debugger?

@zamotany
Copy link
Contributor

zamotany commented Apr 22, 2020

Android works only after "adb -s reverse tcp:8081 tcp:8081"

Running this command is necessary even with Metro and it's more of a Android thing than Haul/Metro/React Native.

/debugger-proxy should be a WebSocket not HTTP route and definitely not a file.

@Natteke
Copy link
Author

Natteke commented Apr 22, 2020

@zamotany yes. Metro works out of the box for both platforms.
Right now Haul issue happening only with ios device.

Everything fine with metro (clear react-native start) and ios.
But after adding default haul, ios real device cannot connect to dev server

@zamotany
Copy link
Contributor

zamotany commented Apr 22, 2020

And the error you've posted is displayed in the terminal when haul start is running?? Or where is that coming from?

@zamotany
Copy link
Contributor

Ah, I know why it's happening, as usual iOS is behaving differently and for some reason makes a HTTP requests to /debugger-proxy here: https://github.com/facebook/react-native/blob/d0871d0a9a373e1d3ac35da46c85c0d0e793116d/React/CoreModules/RCTWebSocketExecutor.mm#L60 whereas Android is constructing correct URL using 'ws://` protocol: https://github.com/facebook/react-native/blob/7cedccdb8d07c87841f96fb327a01568a1a48835/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevServerHelper.java#L362

@zamotany
Copy link
Contributor

There's not easy workaround for that. It needs changes in the haul's server itself, changing how the WebSocket server is created.

@Natteke
Copy link
Author

Natteke commented Apr 22, 2020

{"statusCode":404,"error":"Not Found","message":"File /debugger-proxy not found"}

this error haul dev server shows me in the browser when i tried to get ..../debugger-proxy.
IOS device tries to connect with that path, and i also tried 👯
im not very smart react-native-developer :D

@Natteke
Copy link
Author

Natteke commented Apr 22, 2020

There's not easy workaround for that. It needs changes in the haul's server itself, changing how the WebSocket server is created.

Well, at least we know the problem.

If this reproducible, maybe it could be fixed in some of next releases)

@danlupascu
Copy link

Hey, I'm having this issue too and I think it's kind of important. What's the point of creating such a tool if you can't use the debugger on a real iOS device?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants