haul
haul copied to clipboard
Can't connect to developer's tools from real device (IOS)
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!
Android works only after "adb -s
Is there any workaraunds or something i could do to connect real device to debugger?
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.
@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
And the error you've posted is displayed in the terminal when haul start
is running?? Or where is that coming from?
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
There's not easy workaround for that. It needs changes in the haul's server itself, changing how the WebSocket server is created.
{"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
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)
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?