-
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
Fetch request to jsonplaceholder.typicode.com gets stuck in Pending mode (android) #37907
Comments
***UPDATE: It seems that XMLHttpRequest and fetch take a long long time to get a successful response. It took about 10 minutes to resolve the promise successfully. Now what? What seems to be the problem here? |
I found that the root of the problem was the URL address itself. While this mentioned URL https://jsonplaceholder.typicode.com/posts seems to have a problem, with simple vanilla web JS code it works just fine. Any specific reason for that? Other URLs ie https://dummyjson.com/products work fine either with fetch or XMLHttpRequest. |
Is this the only URL that is causing this issue? Is there anything specific with it? |
I don't know if it is the only url that is causing issues and I am really surprised of this. As already said, curl, browser, and vanilla JavaScript works fine with this url. I didn't find anything specific with this. I can not conclude what causes this specific problem. Maybe something with the server itself? I tested fetch with two more urls and it worked fine. |
This is related to #29698 |
@sdancer75 Hi! did you find a solution?, I am also having this issue, fetch hangs for 2 minutes and gets response, I tried other endpoints but the issue occured in all cases |
It concerns the same website jsonplaceholder.typicode.com? If yes, then no. There is something wrong with this. With my own backend, there is no pending problem. |
I tried with google, wikipedia, github, and Appsync Graphql API endpoints all fetches hang for 2 minutes sometimes. |
If you are having this challenge while testing an API hosted locally( as in http://localhost/api..), replace localhost with your local ip address (as in http://192.168...). This should fix it. |
@crukundo I believe I'm running into the same issue as you are. Testing fetches to my remote host (not local machine), I can confirm that IP address works quite reliably, wheras neither http or https give any reasonable results, returning anywhere from 10 seconds to 2 minutes. Concurrently running fetches on IP, HTTP, and HTTPS also seem to indicate that a successful IP fetch causes the other requests to soon complete as well. For now, I presume this is the Happy Eyeballs issue #32730 ? |
Hi @cortinico, the fetch request return in android I have added Can you help me with a solution? :( thank you! "react-native": "0.73.2", ![]() |
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. |
1 similar comment
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. |
I am also facing the same issue, it is working on my personal laptop but it is working on my office laptop. `import { StatusBar } from 'expo-status-bar'; Sample code const styles = StyleSheet.create({ Error : |
Description
The fetch is stuck in Pending mode. Removing the
@babel/plugin-proposal-class-properties
as proposed at #30187 is not worked for me. Also in my case neither the XMLHttpRequest worked.React Native Version
0.71.11
Output of
npx react-native info
info Fetching system and libraries information...
System:
OS: Windows 10 10.0.19045
CPU: (8) x64 Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
Memory: 3.26 GB / 15.87 GB
Binaries:
Node: 19.1.0 - D:\Program Files\nodejs\node.EXE
Yarn: 1.22.7 - ~\AppData\Roaming\npm\yarn.CMD
npm: 6.14.8 - D:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK:
API Levels: 33, 33
Build Tools: 29.0.3, 30.0.3, 33.0.0, 33.0.2, 34.0.0
System Images: android-33 | Google APIs Intel x86_64 Atom
Android NDK: Not Found
Windows SDK:
AllowDevelopmentWithoutDevLicense: Enabled
AllowAllTrustedApps: Enabled
Versions: 10.0.10240.0, 10.0.10586.0, 10.0.14393.0, 10.0.15063.0, 10.0.16299.0, 10.0.17134.0, 10.0.17763.0
IDEs:
Android Studio: Not Found
Visual Studio: 15.9.33027.88 (Visual Studio Enterprise 2017)
Languages:
Java: javac 11 - C:\Program Files\Java\jdk-11\bin\javac.EXE
npmPackages:
@react-native-community/cli: Not Found
react: 18.2.0 => 18.2.0
react-native: 0.71.11 => 0.71.11
react-native-windows: Not Found
npmGlobalPackages:
react-native: Not Found
Steps to reproduce
npx react-native init list
Replace the App.js with the code example below
Snack, code example, screenshot, or link to a repository
The text was updated successfully, but these errors were encountered: