Fetch API returns Network request failed on some websites.
See original GitHub issuefetch API return Network request failed
only on some websites.
I was trying to ping the api from my website and found out I kept getting a request error. I can ping the url via postman as a normal get request but for some reason the Fetch API won’t let me.
This happens when debugging on Android (note 9)
React Native version:
React Native Environment Info:
System:
OS: macOS 10.14
CPU: (4) x64 Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
Memory: 19.91 MB / 8.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 12.9.1 - /usr/local/bin/node
Yarn: 1.19.1 - ~/.yarn/bin/yarn
npm: 6.12.0 - ~/.config/yarn/global/node_modules/.bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
Android SDK:
API Levels: 27, 28
Build Tools: 28.0.3
System Images: android-24 | Google Play Intel x86 Atom
IDEs:
Android Studio: 3.1 AI-173.4697961
Xcode: /undefined - /usr/bin/xcodebuild
npmPackages:
react: 16.8.3 => 16.8.3
react-native: https://github.com/expo/react-native/archive/sdk-35.0.0.tar.gz => 0.59.8
Steps To Reproduce
- Fetch a famous url (facebook , google) no issue.
- Fetch a less famous url (crash)
Describe what you expected to happen:
Snack, code example, screenshot, or link to a repository:
https://snack.expo.io/SkFgBWoFH
Code to reproduce:
fetch('https://facebook.github.io/react-native/movies.json')
.then(response => {
console.log(response);
})
.catch(function(err) {
console.info(err);
});
fetch('https://pixiumdigital.com')
.then(response => {
console.log(response);
})
.catch(function(err) {
console.info(err);
});
Issue Analytics
- State:
- Created 4 years ago
- Reactions:7
- Comments:13 (4 by maintainers)
Top Results From Across the Web
React Native fetch() Network Request Failed - Stack Overflow
1) and put a fetch in the render method to the public facebook demo movie API, it throws a Network Request Failed ....
Read more >HTTP Fetch fails with "TypeError: Network request ... - GitHub
Using fetch to get/post on a HTTPS web server which is using a valid and trusted but not public CA. Using Chrome and...
Read more >Detect Network Failures When Using Fetch | by Aaron Bruce
Fetch throws “Network request failed” This error will be thrown if you attempt to issue a GET request to “google. comm” — an...
Read more >Improve "TypeError: Network request failed" error message
Network request failed, this error occurs usually when api call failed or you have some internet issue. In android emulator, sometimes this error...
Read more >fetch() - Web APIs | MDN
The global fetch() method starts the process of fetching a resource from the network, returning a promise which is fulfilled once the response...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I don’t think this is stale as a few people have had the same issue and this was never addressed.
This issue has never been fixed as it was never picked up dear bot.