I have a weird issue with making fetch requests to my API on Android (using React Apollo). In the dev build as well as the release build fetch does not work. As soon as I power up React Native Debugger and enable Enable Network Inspect the requests work.
I have no idea how to debug the requests as they are not shown in the debugger without Network Inspect enabled.
Any idea how I could find the error or did anyone of you run into the same issue?
This is presumably because, when this question was asked, React Native did not support fetch
, if I'm not mistaken - and when debugging at that time you had to beware of some oddities, such as the debugger having access to objects/methods which were not available in the actual React Native runtime.
When the debugger was connected, the code is executed in the debugger rather than on the actual device, creating this effect.
You can see here that fetch
requires a polyfill in versions from 2018.
We had to deal with other frustrations in this vein, like the authentication for our app needing to be re-authenticated when first connecting the debugger.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With