-
Notifications
You must be signed in to change notification settings - Fork 24.5k
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
[TypeError: Network request failed] either with fetch API or axios on android #29698
Comments
same here, those api's are so unstable on android: |
I saw your issue. and I try to use my code on snack, and it worked properly : https://snack.expo.io/aXH9PxyIS I just wonder why it doesn't work on a real device. |
Related. Try adding headers and see if that fixes? |
Try this maybe? I had a similar error, had connection but all fetch and axios calls returned an error (and sometimes straight crash depending on the endpoint) but the linked solution worked for me. |
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions. |
Still I have this issue. Sometimes my https api works and sometimes it throws [TypeError: Network request failed] IOS is working fine but not android |
me too |
1 similar comment
me too |
Hi @SohaibKtb @akeuk The issue got resolved for me after correctly installing the SSL Certificate. |
@gvsakhil , can u please let me know the steps to install SSL certificate in Android & iOS? |
how? i have same problems |
Same issue here, but the TLS certificates are correctly installed:
|
You can try my solution
|
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
The In any case, throwing a generic error is a bug without any doubt. And it should be fixed. |
|
The In any case the react-native api does not provide a detailed error information, which is the point of this open issue. |
I created a new Expo project, added only one fetch button and tested, with iOS it works without any issue, hang is occuring on Android, when I leave the phone for 5 minutes and then call function it defenitely waits always ~2 minutes to send request and get response, I am looking for soluftion for a week but cannot find any solution, |
This is not very relevant.
My suggestion:
|
I got it, thank you, I opened a new issue and looking for a help from admins! |
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
This issue was closed because it has been stalled for 7 days with no activity. |
... "with no fix" would better represent the general problem |
Please I am having the same issues now and I need help in solving it |
any one solve this ? |
|
I have a problem with fetching an API on my code I use both fetch and axios but the result is same:
[type error: Network request failed]
here is my code for fetch:
useEffect(() => { fetch('https://jsonplaceholder.typicode.com/users') .then((res) => res.json()) .then((data) => { console.log(data) }) .catch((err) => console.log(err)) }, []);
I don't use an emulator because my CPU doesn't support vt-x. so I use a Xperia TX which has android 4.3 and I connect it over Wi-Fi to see my result. it work properly so far but the only problem is this API fetching.
React Native version:
0.63.2
The text was updated successfully, but these errors were encountered: