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
Network Error in React Native #6302
Comments
I'm getting the same error, but only from Android. I don't think this is related to Axios because I used the bare JavaScript fetch method and the API call just never resolves. |
I'm stuck at this problem for like 1 week. Some people say that axios isn't using an API that called |
Honestly, in my case, I'm convinced that this is a backend problem. I created a basic Node.js backend and made a similar API call to it; everything was working just fine. We are looking into the issue and will keep you updated if we figure this out. |
@nkqdev If it's GET data, if fetch data error, it should have chance to retry few times. check this article 3 Tips to Make Your App More Stable @kurucaner And the android error, I think it's because you use '127.0.0.1' or 'localhost', I met this error before, and change the local IP to LAN ip(for example, like 192.168.1.10), then it's worked. I use expo and this is how I get LAN ip in dev mode: import Constants from 'expo-constants';
const host = Constants.expoGoConfig?.debuggerHost?.split(':')?.[0];
const API_URL = process.env.EXPO_PUBLIC_API_URL || '';
export const baseURL =
host &&
(host.startsWith('192.168') || host.startsWith('10.') || host.startsWith('172.')) &&
(API_URL.indexOf('localhost') > -1 || API_URL.indexOf('127.0.0.1') > -1)
? 'http://' + host + ':' + (API_URL.split(':').pop() || '')
: API_URL; |
@suhaotian I'm using |
same issue ,any resolution? |
Em facing the same issue ....! |
1 similar comment
Em facing the same issue ....! |
Describe the bug
When i'm
POST
a request then in the processing i'm switch to another app (before i'm receive response from server) then when i'm come back it sayNetwork Error
is anyone have the same issue and know the way to deal with this problem?To Reproduce
No response
Code snippet
No response
Expected behavior
No response
Axios Version
^1.6.2
Adapter Version
No response
Browser
No response
Browser Version
No response
Node.js Version
No response
OS
iOS 16.4
Additional Library Versions
Additional context/Screenshots
No response
The text was updated successfully, but these errors were encountered: