Can't run expo project on LAN without internet connectivity - react-native

I'm using OSX and when I tried to run my expo app on connected android or iphones, I got an error saying
Something went wrong.
Could not load exp://102.168.43.87:19000. Network response timed out.
But when I'm using a Windows system to start expo, its working on the same LAN without internet.
Any solution?

Related

Can't access NestJS API on same network

When trying to access my NestJS api running locally MacBook from a React Native app, axios gives me a LOG "Could not connect to the server.". Even when trying to access the http://192.168.65.1:3000/ from another laptop does not work. I can weirdly ping the server from another device just fine. And running it on the same MacBook with localhost also works. I have set up a fairly basic NestJS api with Fastify. I have no firewall running. What the hell am I missing?

Cannot connect to localhost web page from Bluestacks Android emulator

I'm troubleshooting an issue on our website which I can only reproduce using an Android phone or Android emulator, not using a browser's built-in emulator. On my environment (cloud VM), the only emulator that works is BlueStacks. I am running the website locally from Visual Studio (ASP.NET Core) on port 7086. However, I can't connect to it from the emulator. I have tried connecting to 10.0.2.2:7086, but I get ERR_CONNECTION_TIMED_OUT. The only answers I can find on StackOverflow indicate that this should work, so I'm not sure what else to try. Thanks!

uncaught Error: java.net.ConnectException: Failed to connect to /192.168.10.7:19000

I was working on my expo app, and yesterday, totally at random, when I was launching "expo start" and then scan the QR code to see my app, this error appeared. I am now unable to access my app through a LAN connection, it works fine with Tunnel but I really don't understand why this happened.
Again, it happened at random after a day of normal work where everything was working fine. Did anyone have the same issue?
I got the same issue. Make sure your computer and mobile are connected to the same Internet Network.
In my case my mobile and computer, both were connected to different Wifi networks. So make sure that both the devices are connected to the same network.

React Native Expo can't connect from phone to laptop on same wifi

I am building react native app with expo and I'm currently using public wifi because I'm traveling.
On the bus and in the hostel's wifi I've experienced an issue:
- Phone can't connect to Expo running on Laptop (same LAN wifi)
After trying many times to connect using the wifi, and also trying to see if Windows firewall has something to do with it, I finally found out what might be the issue and a temporary workaround.
Issue:
Some routers have a configuration called AP Isolation, that might be activated on the router/wifi of the public place you're using, to avoid someone hack into someone else's computer. So basically no device on the same network can communicate with the other.
Temporary workaround:
The only way I've got this working was by enabling a Wifi Hotspot on my Android phone and connecting the laptop to it. This means I'm using my phone's 4G connection for internet too. Expo seems like it needs to access the Internet and if you don't have data won't work.
The other way might work is if your Windows or Mac computer is able to create a virtual access point. So instead of connecting laptop to phone, you do it the other way around.
Hope this helps someone!
You should be able to run on a virtual device via expo. On my Macbook I run on iOS if doing work in a place where I do not have internet but on a PC you should be able to run the Android Emulator.
While this might not provide the not intuitive way of doing things as you'll be using a virtual device instead of a physical one, it still is very quick and responsive. Just know that animations may not be as smooth.
I fly frequently and running on virtual devices has enabled me to work when otherwise it would be impossible.

React-Native simulate device is disconnected

Turning genymotion (or device) wifi causes app be unable to connect to app bundle and goes to show the red error in react-native. So how can I simulate app behavior when is disconnected from the internet (and also developing to have a good react (I mean it's not just about testing, also developing))?
There are only 4 states possible:
connected with good connection (have access to remote servers)
connected with poor connection (loss percentage is high)
connected with zero connection (have not access to remote servers - 100% loss)
not connected
Simulations way depends on which situation you need and where your app is running (device:iOS, Android?, simulator: mac, windows?)
On iOS you have Developer menu in the preferences and Network Link Conditioner in.
On Mac you can install Network link conditioner by this
I`m sure android has some tool for it.
Can`t say something about windows, sorry