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.

Expo Client iOS opening port 80

See original GitHub issue

Environment

  Expo CLI 2.6.13 environment info:
    System:
      OS: Linux 4.15 Ubuntu 18.04.1 LTS (Bionic Beaver)
      Shell: 5.4.2 - /usr/bin/zsh
    Binaries:
      Node: 8.10.0 - /usr/bin/node
      Yarn: 1.12.3 - /usr/bin/yarn
      npm: 3.5.2 - /usr/bin/npm
    npmPackages:
      expo: ^31.0.2 => 31.0.6 
      react: 16.5.0 => 16.5.0 
      react-native: https://github.com/expo/react-native/archive/sdk-31.0.0.tar.gz => 0.57.1 
    npmGlobalPackages:
      expo-cli: 2.6.13

In Expo client version 2.9.0

Steps to Reproduce

Expo generates a QR code which points to exp://192.168.1.21:19000 but after scanning QR code from my iPhone and opening it in Expo Cli expo tries opening exp://192.168.1.21:80/node_modules

BTW it’s a blank expo app. photo_2018-12-16_16-47-33 photo_2018-12-16_16-49-12

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
Maxwell2022commented, Jan 16, 2019

It’s also happening on Android. Not sure why the iOS and Android build are generating the bundle url targeting the port 80 whereas the expo start is running on port 19000. I believe this should be a bug.

Apparently clean project and rebuild while the bundler is running on port 19000 is fixing this for some developers. Some say that Android Studio needs to be closed when starting the metro bundler and only opening it once started, maybe it’s the same for iOS. To my experience, this work around are not 100% working.

I think the proper solution to fix this “miss-match port” is to run the following expo command (only if you app is detached):

expo prepare-detached-build

It will update the DEVELOPMENT_URL in both iOS and Android project with the correct host / port. Just make sure the Metro bundler is running while you are doing this.

For production build, you need to publish the “experience” (javascript bundle) to expo using expo publish prior to build iOS & Android signed binary. Also make sure you are publishing in the correct expo account if you have multiple account (expo w to check / expo login to change). I also believe that the update option should be disabled in App.json:

    [...]
    "updates": {
      "enabled": false
    },

I hope that fix your issues. I still believe someone should look into this bundler port miss-match, I don’t know why it’s happening

2reactions
extrincommented, Aug 15, 2019

I suffer from this bug too. Things suggested by @Maxwell2022 didn’t help. I have the correct setting ‘DEVELOPMENT_URL’ but Android Studio always tries to go to port 80 instead of port 19000. Hope there is a solution…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Calling locally hosted server from Expo App - Stack Overflow
Replace port 80 to your api server port no. Make sure you have open server port (80) in firewall in laptop. Save this...
Read more >
Expo CLI - Expo Documentation
Generate the native iOS and Android directories for your project: npx expo ... Will open apps to: exp://expo.dev:80 (the :80 is a temporary...
Read more >
Run an expo webserver with port forwarding
The first time a client accesses it after a startup a build will be created and minified. After that it should be quite...
Read more >
How to I connect my iPhone via USB tethering to an Expo ...
This is really quite simple - just plug the phone via a Lightning to USB cable into the Mac to get a network...
Read more >
How to simultaneously start multiple instances of iOS ... - ITNEXT
And it will automatically start the selected simulators, as well as install the Expo app opening the Expo app on port 19000. Now...
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