How to solve the Network response timed out problem in Expo
Emdadul Islam
Software Engineer
1st January 2024
APP development
Expo
Resolving the "Network Response Timed Out" Issue in Expo (Linux/Ubuntu)
If you’re developing a React Native app with Expo and encounter a “network response timed out” error, it’s likely due to the port that Expo’s Metro bundler is running on not being open on your machine.
The solution is to open the necessary port so that your device or emulator can connect to the Metro server.
Steps to Solve the Expo Network Response Timed Out Problem on Linux (Ubuntu)
1. Check the Current Open Ports
In your terminal, run the following command to view the currently open ports:
sudo ufw status verbose
- Look for the port that Expo’s Metro bundler is running on (usually 8081).
- If you don’t see the port listed, you’ll need to open it.
2. Open the Expo Metro Port
Run the following command to open the Expo Metro port (replace 8081 with the port number if different):
sudo ufw allow 8081/tcp
- This command will open the port and allow traffic to flow through it.
Additional Tips
- After following these steps, the “network response timed out” issue should be resolved, and you should be able to connect your device or emulator to the Expo Metro server without any problems.
- If you continue to encounter issues:
- Check your firewall settings to ensure the specified port is not being blocked.
- Restart your development environment or the Expo Metro server.
With these steps, your Expo development workflow on Linux/Ubuntu should proceed smoothly.
expo
expo go