-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
iOS: Connection to development server frequently lost? #12786
Comments
You are not alone. RN: 0.41.2 |
Further testing shows this issue doesn't seem to appear on Android devices. I have a server running and can connect with my Android device, while iOS fails to connect after a certain time, even after re-running a server. |
I am not sure about the instructions in this output:
Node server URL does not appear in AppDelegate (any more), and I can't find instructions to do this. Is there possibly a fix without rerunning the app? Could this resolve with an upgrade? |
Same here! It randomly stops working, even though my IP addresses are correct and not changing. Usually if I wait a minute or so, I can tap Reload, and then it'll start working fine for another 30-60mins. |
Summary: When running an app on a real iPhone in debug mode, I occasionally get issues when trying to load the js bundle and I suspect the issue is with xip.io (and it doesn't look like I'm the only one: #12786 #9688 (comment)). So I've added the ability to optionally disable the use of xip.io if an env variable `DISABLE_XIP` is set. Add `export DISABLE_XIP=true` to the `Bundle React Native code and images` build phase. Run the app on a real iPhone and ensure that it can load the JS bundle from the host computers IP. Closes #13326 Differential Revision: D4855719 Pulled By: ericvicenti fbshipit-source-id: cb2e91291acadaa78ea302800b55c2e5388f6380
Summary: When running an app on a real iPhone in debug mode, I occasionally get issues when trying to load the js bundle and I suspect the issue is with xip.io (and it doesn't look like I'm the only one: facebook/react-native#12786 facebook/react-native#9688 (comment)). So I've added the ability to optionally disable the use of xip.io if an env variable `DISABLE_XIP` is set. Add `export DISABLE_XIP=true` to the `Bundle React Native code and images` build phase. Run the app on a real iPhone and ensure that it can load the JS bundle from the host computers IP. Closes facebook/react-native#13326 Differential Revision: D4855719 Pulled By: ericvicenti fbshipit-source-id: cb2e91291acadaa78ea302800b55c2e5388f6380
Summary: When running an app on a real iPhone in debug mode, I occasionally get issues when trying to load the js bundle and I suspect the issue is with xip.io (and it doesn't look like I'm the only one: facebook#12786 facebook#9688 (comment)). So I've added the ability to optionally disable the use of xip.io if an env variable `DISABLE_XIP` is set. Add `export DISABLE_XIP=true` to the `Bundle React Native code and images` build phase. Run the app on a real iPhone and ensure that it can load the JS bundle from the host computers IP. Closes facebook#13326 Differential Revision: D4855719 Pulled By: ericvicenti fbshipit-source-id: cb2e91291acadaa78ea302800b55c2e5388f6380
Hi there! This issue is being closed because it has been inactive for a while. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. Either way, we're automatically closing issues after a period of inactivity. Please do not take it personally! If you think this issue should definitely remain open, please let us know. The following information is helpful when it comes to determining if the issue should be re-opened:
If you would like to work on a patch to fix the issue, contributions are very welcome! Read through the contribution guide, and feel free to hop into #react-native if you need help planning your contribution. |
still happens |
It's because of the use of xip.io. Latest RN includes a way to disable it. I like to setup a VPN (ZeroTier) on both mac and iphone and hardcode my VPN IP in that build script ( |
This error occurs for many reasons. Thanks @tybro0103 for adding the fact that the build script adds xip.io to the ip address. xip.io does not work on many routers and you are left scratching your head because the error message is misleading and does not report the actual address being used. So to see if that is your problem just nslookup myipaddress.xip.io. If it does not resolve then you need to, as the PR suggests add DISABLE_XIP to shell script script for bundle react native code and images. |
Thanks @tybro0103 and @selsamman I was struggling with this for weeks... :D |
Might be worth mentioning the reason I discovered this... With xip.io, things worked about 90% of the time for me. But when it started failing would take me ~10 minutes to get it to work again... pretty disruptive thing to deal with while working on an app. Don't know why the xip.io address would sometimes be fine and sometimes not, but that was the case even at home (not a corporate network), but things work all of the time without xip.io. |
Yeah for me it worked at home too but not at the office. So are corporate networks different somehow? |
It is not clear to me why xip.io should be on by default. The whole package manager interface is pretty fragile and having one more banana peel just doesn't make sense to me. Maybe I am missing something about why xip.io is needed in the first place for this use-case. In my case I travel a fair bit and each time and it is always aggravating getting things going again on a new network. Often I just use my phone as a hot spot just avoid this. The xip.io problem I found on only one router in my travels. It is not clear though whether it was the router or the service provider that was the source of the problem. |
@selsamman Check this comment why they use xip.io #8850 (comment) |
On device refresh (shake device > reload), the error "Could not connect to development server" occasionally shows up. At other times, reloading doesn't update the live app, even when code has changed, but no error is thrown.
If I try to run a new server with
npm start
, it reports that there is already a development server running. I have to stop the server and rerun the app before this resolves.I was under the impression that we don't need to change
jsCodeLocation
any more, as those instructions we removed from documentation, and running live through the device works with a fresh RN project.It happens every hour at least. I can't reliably reproduce it.
Additional Information
Currently using the following modules:
I'm also using a CocoaPods workspace to load google maps dependencies not included with iOS.
This is untested on Android, so just an iOS issue.
Developing on MacOS Sierra 10.12.2.
I realize this may be a troubleshooting issue for my setup but as the instability only began after RN^40, I'm wondering, am I alone with this?
The text was updated successfully, but these errors were encountered: