Possible Unhandled Promise Rejectio on android device
Like #5338, it was closed. but the warn "Possible Unhandled Promise Rejectio" still alive on android device "Red mi" when I save file.
Make sure that everywhere you have a promise chain, you're finalizing the chain by calling the non-standard .done()
e.g. fetch( someurl ).then( processdata ).catch( processerror).done()
If it turns out that EVERYWHERE you have a promise you have resolved the chain in this manner, then it's possible this is an RN bug, but I think it's more likely this warning is working as intended
@mangogogos I run the original init project, it throw the warn message.problem like #5338 . it's closed, but I got same warn message again.
Same here.
Warning Possible Unhandled Promise Rejection occurs in app running on android device whenever hot reloading happens.
Repro steps:
- Run
react-native init someproject - Ensure physical android device is plugged in
cd someproject && react-native run-android
then on device
- Menu > Dev Settings > Debug server host & port for device
- Menu > Enable Hot Reloading
- Menu > Reload JS
Save file index.android.js and observe the warning.
Environment: react-native-cli: 0.2.0 react-native: 0.24.1 Android version: 4.4.4
Have the same warning when hot reload is enabled even though it still updates the view.
Waning:
Possible Unhandled Promise Rejection (id:0):
Network request failed
onerror@http://10.0.0.1:8081/
index.android.bundle?platform=android&dev=true&hot=true&minfy=false:18405:21
_sendEvent@http://10.0.0.1:8081/
index.android.bundle?platform=android&dev=true&hot=true&minfy=false:17872:9
setReadyStatet@http://10.0.0.1:8081/
index.android.bundle?platform=android&dev=true&hot=true&minfy=false:17858:16
_didCompleteResponse@http://10.0.0.1:8081/
index.android.bundle?platform=android&dev=true&hot=true&minfy=false:17749:19
call@[native code]
@http://10.0.0.1:8081/
index.android.bundle?platform=android&
Environment: OS: Arch Linux Device: Samsung Galaxy S5 react-native-cli: 0.2.0 react-native: 0.25.1 Android SDK Tools 25.1.6 Android SDK Platform-tools: 23.1 Android SDK Build-tools: 23.0.3
Same here.
OS: OSX Device: Huawei react-native-cli: 1.0.0 react-native: 0.27.2
me too: OS: OSX Device: iphone6 react-native-cli: 1.0.0 react-native: 0.27.2&0.28
Same here.
OS: OSX Device: Huawei react-native-cli: 1.0.0 react-native: 0.27.2
And it only happens when setting debug server host & port for device, no warning for adb reverse
Hi there! This issue is being closed because it has been inactive for a while.
But don't worry, it will live on with ProductPains! Check out its new home: https://productpains.com/post/react-native/possible-unhandled-promise-rejectio-on-android-device
Product Pains has been very useful in highlighting the top bugs and feature requests: https://productpains.com/product/react-native?tab=top
Also, if this issue is a bug, please consider sending a pull request with a fix.
+1