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.

[0.54.4] Metro Bundler can't listen on port undefined

See original GitHub issue

Hi, I’m running the latest version of React Native and all goes well, except running from CLI to your device. Whenever I run react-native run-ios --device it fails with Metro Bundler can't listen on port undefined.

The issue has been fixed in https://github.com/facebook/react-native/pull/17983 however, but is scheduled for 0.55. Which makes the current latest version just unusable and broken. Backport needed asap.

Environment

Environment:
  OS: macOS High Sierra 10.13.3
  Node: 9.8.0
  Yarn: 1.3.2
  npm: 5.7.1
  Watchman: 4.9.0
  Xcode: Xcode 9.2 Build version 9C40b
  Android Studio: Not Found

Packages: (wanted => installed)
  react: ^16.3.0 => 16.3.0
  react-native: ^0.54.4 => 0.54.4

Steps to Reproduce

Run react-native run-ios --device in any React Native project using the latest 0.54.4 release.

Expected Behavior

Start the metro bundler correctly and continue compiling the application.

Actual Behavior

Metro bundler fails because the port is undefined.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:10
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
hramoscommented, Apr 3, 2018

As this is already fixed in master, closing as Fixed.

0.55 should be getting released any moment. You may also discuss cherry-pick requests over at https://github.com/react-native-community/react-native-releases.

0reactions
hatlestadcommented, Apr 4, 2018

I’ve got the same issue as @jacktator and @wouterds

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot read properties of undefined (reading 'transformFile ...
The error comes from the node version. So, you will need to downgrade. npx react-native info - // to see what node version...
Read more >
React-Native Error Metro Bundler Can't Listen On Port 8081 ...
Whenever I run reactnative runios device it fails with Metro Bundler can't listen on port undefined. The issue has been fixed in #17983....
Read more >
Cannot read property 'url' of undefined when starting server.js ...
TypeError: Cannot read property 'url' of undefined when starting server.js ... var io = socket_io.listen(server, {port: settings.port, ...
Read more >
Port showing as undefined even though it's defined - Treehouse
Server running at http://undefined/ ... The "listen" method typically takes a port number as an argument (and an optional callback function) ...
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