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] RCTBundleURLProvider isPackagerRunning stalls for wifi-disabled device #10187
Comments
What's the problematic result here - when you run on a device with no internet connection it silently fails and the ideal would be to log a message saying "there's no internet"? If you have a specific fix in mind with the semaphore then it would be really cool to submit a PR fixing it.... |
Both https://stackoverflow.com/questions/44102199/react-native-dev-mode-app-doesnt-fallback-to-offline-bundle-on-physical-device and https://stackoverflow.com/questions/43616804/react-native-ios-app-crashes-when-run-outside-of-xcode-with-failed-to-scene-crea are caused by this. My expectation is that it should fall back to the offline bundle. Really, with a dev build, I can't use the app in offline mode because of this issue. |
I have a temporary workaround and am putting it here for documentation purposes in case someone with a better knowledge of objective-c (i have none), url resolution and Disclaimers: In RCTBundleURLProvider.m (isPackagerRunning) replace the commented section with what's below:
This will cause URL resolution to time-out in 5 seconds and therefore fallback to the offline bundle. |
Proper fix discussion: I'm not sure if this possible, but this synchronous call to figure out if the packager is running - Also, I'd like to add that I've noticed that switching back and forth between WiFI and cellular doesn't work well and is quite fragile. React falls back to |
ping |
ping as well. also having this problem. |
Can we get a 'needs help' label on this? would be cool if someone with objective-c knowledge can help out on this. |
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. |
Specifically this line is blocking the thread when using a device (with WIFI unknowingly disabled).
Might want to use a semaphore and
RCTLogError
.Otherwise, the user is left confused about the stalled thread.
The text was updated successfully, but these errors were encountered: