-
Notifications
You must be signed in to change notification settings - Fork 24k
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
App hangs on http request using axios, but works on "Debug JS remotly" #21892
Comments
We are automatically closing this issue because it does not appear to follow any of the provided issue templates. Please make use of the bug report template to let us know about a reproducible bug or regression in the core React Native library. If you'd like to propose a change or discuss a feature request, there is a repository dedicated to Discussions and Proposals you may use for this purpose. |
We are automatically closing this issue because it does not appear to follow any of the provided issue templates. Please make use of the bug report template to let us know about a reproducible bug or regression in the core React Native library. If you'd like to propose a change or discuss a feature request, there is a repository dedicated to Discussions and Proposals you may use for this purpose. |
stupid bot -_- |
@fedecryto did you solve this issue? |
@fedecryto, @saleem-hadad I just found and fixed this issue in my project - a nightmare to track down! This is probably be a bit late for you, but hopefully not for others. Turns out that I was using Basic Authentication, and btoa isn't defined in RN except when you're using remote debugging. There's a good explanation here: The "js is actually running in chrome with remote debug" aspect of this should (IMHO) really be highlighted more, preferably with big blink tags in the documentation. Hope this helps....someone. |
Downgrade your axios version to 0.18.0. |
Hi!
I'm having problems to perform any http request using axios to a local server:
axios.post(url, data)
and for url I tried:
url = "http://localhost:3000/authenticate"
url = "http://127.0.0.1:3000/authenticate"
url = "http://192.168.1.10:3000/authenticate"
//server ip addressurl = "http://10.0.2.2:3000/authenticate"
//emulator addressand NONE of them worked...
The funny thing (and I can't understand why) is that as soon as "Debug JS Remotely" the following url worked perfectly:
url = "http://10.0.2.2:3000/authenticate"
//emulator addressSo, how should it be my set up to make this work without debugging js remotely??
Trying this on a android device.
"dependencies": {
"axios": "^0.18.0",
"babel-eslint": "^8.0.2",
"country-data": "0.0.31",
"hoist-non-react-statics": "^3.0.1",
"libphonenumber-js": "^1.4.3",
"native-base": "^2.7.2",
"prop-types": "^15.6.0",
"react": "16.3.1",
"react-native": "~0.52.2",
"react-native-animatable": "^1.2.4",
"react-native-cli": "^2.0.1",
"react-native-contacts": "^2.2.2",
"react-native-easy-toast": "^1.1.0",
"react-native-elements": "^0.19.1",
"react-native-google-places-autocomplete": "^1.3.9",
"react-native-keyboard-aware-scroll-view": "^0.4.1",
"react-native-linear-gradient": "^2.3.0",
"react-native-maps": "^0.21.0",
"react-native-navigation": "^1.1.479",
"react-native-scrollable-tab-view": "^0.8.0",
"react-native-splash-screen": "^3.1.1",
"react-native-tab-view": "^1.0.2",
"react-native-toaster": "^1.2.2",
"react-native-vector-icons": "^5.0.0",
"react-redux": "^5.0.7",
"redux": "^4.0.0",
"redux-thunk": "^2.2.0",
"tinycolor2": "^1.4.1"
}
The text was updated successfully, but these errors were encountered: