question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

App hangs on http request using axios, but works on "Debug JS remotly"

See original GitHub issue

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 address url = "http://10.0.2.2:3000/authenticate" //emulator address

and 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 address

So, 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” }

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:6

github_iconTop GitHub Comments

3reactions
Deepaknathtiwaricommented, Jun 24, 2019

Downgrade your axios version to 0.18.0.

3reactions
saleem-hadadcommented, Jan 12, 2019

stupid bot -_-

Read more comments on GitHub >

github_iconTop Results From Across the Web

App hangs on axios request to local server, but works ... - GitHub
Hi! I'm having problems to perform any http request using axios to a local server: axios.post(url, data).
Read more >
Why do my https requests hang for several minutes?
It comes and goes (can work 100 times, then stop working); looks like https fails when http succeeds; The same requests work perfectly...
Read more >
A Complete Guide to Winston Logging in Node.js - Better Stack
Learn how to start logging with Winston in Node.js and go from basics to best practices in no time.
Read more >
How to Debug Any CORS Error - HTTP Toolkit
Your request is hitting an error due to CORS. Not all is lost! Most CORS errors are quick & easy to debug and...
Read more >
Handling data fetching in Next.js with useSWR - LogRocket Blog
I tried it but it didn't quite work, hence why I'm using Axios instead. Let's check back on the browser and see if...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found