-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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 Request Failed #16081
Comments
I have this problem too on android |
Have you guys looked at this? https://stackoverflow.com/questions/38418998/react-native-fetch-network-request-failed |
if someone try to use emulator fetching "http://localhost/" or http://127.0.0.1/, |
@facebook-github-bot no-template |
Hey, thanks for reporting this issue! It looks like your description is missing some necessary information, or the list of reproduction steps is not complete. Can you please add all the details specified in the Issue Template? This is necessary for people to be able to understand and reproduce the issue being reported. I am going to close this, but feel free to open a new issue with the additional information provided. Thanks! See "What to Expect from Maintainers" to learn more. |
@AAGSICON @1048034876 - hey guys, have you reach a fix for it please? I'm stuck. Thanks a lot! |
im stuck this too. |
you can try your ip instead of localhost |
Dont get your ip from a website like findmyip.com go to the cmd and ipconfig |
I had the same error using http://localhost:8000 as my development server. I think on react native 0.52.x it worked fine, but after upgrading to 0.54.x it caused the network request failed error. As mentioned in #16081 (comment) and #16081 (comment), replacing localhost with my actual IP (not 127.0.0.1) didn't cause the error anymore. |
how to change the default IP address as development server? |
this fix the problem |
var SERVER_SIGNUP_URL = 'https://192.168.0.80/Registration/Registration.php';
fetch(SERVER_SIGNUP_URL + '?username=' + this.state.username + '&password=' + this.state.password)
.then((response) => response.json())
.then((responseData) => {
var id = responseData.id;
if (id === -1) {
this.hideProgressBar();
showMessage("Something is bad", "This username is already taken");
}
else {
this.props.navigator.push({
name: 'contacts',
password: this.state.password,
id: id,
username: this.state.username
});
}
})
.done();
The text was updated successfully, but these errors were encountered: