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.
Currently using the following modules:
"lottie-react-native": "1.0.5",
"react": "15.4.1",
"react-native": "^0.41.2",
"react-native-blur": "^2.0.0",
"react-native-datepicker": "^1.4.2",
"react-native-maps": "0.13.0",
"react-native-scrollable-tab-view": "^0.7.2",
"supercluster": "^2.3.0"
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?
You are not alone.
RN: 0.41.2
iOS 10.2.1
Mac Sierra 10.12.3
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:
URL: http://192.168.100.14.xip.io:8081/index.ios.bundle?platform=ios&dev=true&minify=false
2017-03-16 15:54:07.251243 Oreal[3609:8148924] Could not connect to development server.
Ensure the following:
- Node server is running and available on the same network - run 'npm start' from react-native root
- Node server URL is correctly set in AppDelegate
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.
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 (node_modules/react-native/scripts/react-native-xcode.sh). This way I don't have to build from Xcode whenever my IP changes. But it is pretty hacky cuz it'll get over-written since it's in node_modules. Might be worth opening a PR have react-native-xcode.sh try to use a DEV_IP ENV var.
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 https://github.com/facebook/react-native/issues/8850#issuecomment-233351494
Most helpful comment
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.