facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
119.23k stars 24.33k forks source link

[0.55.0] Metro Bundler can't listen on port undefined #18681

Closed ASteinheiser closed 6 years ago

ASteinheiser commented 6 years ago

screen shot 2018-04-03 at 2 44 27 pm

Environment

OS: macOS High Sierra 10.13.3 Node: 7.9.0 Yarn: Not Found npm: 4.2.0 Watchman: 4.9.0 Xcode: Xcode 9.3 Build version 9E145 Android Studio: 3.1 AI-173.4670197

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

Steps to Reproduce

react-native init AwesomeProject
cd AwesomeProject
react-native run-ios

Expected Behavior

Build Successful!

Actual Behavior

Metro Bundler can't listen on port undefined

react-native-bot commented 6 years ago

Thanks for posting this! It looks like your issue may be incomplete. Are all the fields required by the Issue Template filled out?

If you believe your issue contains all the relevant information, let us know in order to have a maintainer remove the No Template label. Thank you for your contributions.

How to ContributeWhat to Expect from Maintainers

ASteinheiser commented 6 years ago

Can confirm that using react-native: 0.52.2 fixed this issue for me.

leofontes commented 6 years ago

This is happening to me too, 0.52.2 with React 16.2.0 fixed it.

zen0wu commented 6 years ago

Apparently this is related to #18525, that issue fixes device but simulator is still broken, because port is not passed into buildProject.

https://github.com/facebook/react-native/blob/master/local-cli/runIOS/runIOS.js#L130

Adding args.port as the last argument to this function call should temporarily fix the issue

kaushal9678 commented 6 years ago

after updating npm i also get error when running command react-native init-ios. React Native 0.55.0 CFBundleIdentifier error after fixing metro port But the projects that are created with lower version is works fine without any error.

I have following versions of NPM, react-native, node js react-native-cli: 2.0.1 react-native: 0.55.0, I downgrade NPM version to this npm 3.10.10 node -verison v6.14.1

wouterds commented 6 years ago

@shivawu That patch is already included in RN 0.55, it does not fix the issue. It did work on 0.54.4.

hatlestad commented 6 years ago

I am experiencing the same issue with 0.55.0.

donjordano commented 6 years ago

Same here!

kelset commented 6 years ago

First off, PLEASE don't pollute the issue with useless 'same issue' comments.

There are the reactions for indicating that this issue is present.

That said, please don't use 0.55.0 because it ships with the wrong version of React. We are going to release soon a new version.

grabbou commented 6 years ago

I believe we need to fix this as soon as possible - @kitze was reporting this to me yesterday. I will take a closer look before releasing a new version.

zen0wu commented 6 years ago

@wouterds if you read through my comment, I provided another fix for this current problem, that issue is only a reference

zen0wu commented 6 years ago

I have to say the release process has been very carelessly, recently.

Each major release has flaws that makes it unusable. Especially with 0.54 and 0.55. I always have postinstall script setup to fix react-native. Feel like it’s SEV worthy and time to revise the process

hramos commented 6 years ago

@shivawu the release spends around a month as a release candidate. That's a great time to give the RC a try and surface any issues, prior to the stable release being cut.

zen0wu commented 6 years ago

I’m aware of the Rc version and really appreciated the effort. Yet these seems-easy-to-discover bugs slipped through into the stable release, just saying there seems the process can be improved

hramos commented 6 years ago

Definitely. Beefing up our test suite is another way of contributing a solution to this. I'd appreciate any PRs in that area.

wouterds commented 6 years ago

@shivawu: No, we're talking about the same issue and fix. See thread of OP mentioning #18673 which mentions #17983 which is exactly the fix you provided, and is already included in 0.55.0.

zen0wu commented 6 years ago

That's not the same patch. That one is on line 71, which fixes for devices, mine is on line 130, which fixes simulator.

wouterds commented 6 years ago

@shivawu: I rest my case. 😅

zen0wu commented 6 years ago

I know, it's super confusing, for a minute I bought what you said, lol 😂

grabbou commented 6 years ago

The regression has been introduced in this commit: https://github.com/facebook/react-native/commit/2ad34075f1d048bebb08ef30799ac0d081073150. I am going to fix it by adding args.port (which as you can see from the diff has been removed by a mistake).

grabbou commented 6 years ago

You can find a fix here: https://github.com/facebook/react-native/commit/589eae1432cc4bbc16221f841e27b038099fd128

grabbou commented 6 years ago

@shivawu The releases are cut very carefully, but there's just too many pieces to test at one time. That's why having people to use release candidates would prevent such obvious errors from leaking into production.

Recent issues have to do with runIOS which is not part of our manual and automated testing.

grabbou commented 6 years ago

Yeah, I fixed both in 0.55. https://github.com/react-native-community/react-native-releases/issues/11#issuecomment-378889572

On Thu, 5 Apr 2018 at 23:50 Mateo Guzmán notifications@github.com wrote:

With this solution #18681 (comment) https://github.com/facebook/react-native/issues/18681#issuecomment-378441952 the metro bundler works. But, still appearing this error.

[image: image] https://user-images.githubusercontent.com/20783123/38393680-3285f4ee-38f1-11e8-9fee-4fcd385e2ca2.png

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/facebook/react-native/issues/18681#issuecomment-379087451, or mute the thread https://github.com/notifications/unsubscribe-auth/ACWcxvQXBEOP_1y35EfG4NMBnz4uyFXrks5tlpHBgaJpZM4TF1kc .

wellyshen commented 6 years ago

@grabbou I upgraded to 0.55 and run react-native run-ios it build success but the simulator won't be launched. so wired...

grabbou commented 6 years ago

Interesting. I had it already launched (you can turn it on by pressing CMD Space and typing simulator).

I'll take a closer look at the full run ios diff, that's alarming if this feature doesn't work either.

On Fri, Apr 6, 2018, 6:26 AM Welly notifications@github.com wrote:

@grabbou https://github.com/grabbou I upgraded to 0.55 and run react-native run-ios it build success but the simulator won't be triggered. so wired...

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/facebook/react-native/issues/18681#issuecomment-379144541, or mute the thread https://github.com/notifications/unsubscribe-auth/ACWcxkWj14c3lCenGrWNuY_Lm-AB0kDmks5tlu50gaJpZM4TF1kc .

wellyshen commented 6 years ago

@grabbou Thank you for this temporary solution.

grabbou commented 6 years ago

Here's my proposed fix: https://github.com/facebook/react-native/commit/2ad34075f1d048bebb08ef30799ac0d081073150#r28448345 Waiting for feedback and will release a patch.

I am really sorry for all the inconvenience issues with the command line tools caused for you. For the future, we will make sure to pay even more attention to commits affecting the CLI.

On Fri, 6 Apr 2018 at 09:10 Welly notifications@github.com wrote:

@grabbou https://github.com/grabbou Thank you for this temporary solution.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/facebook/react-native/issues/18681#issuecomment-379167892, or mute the thread https://github.com/notifications/unsubscribe-auth/ACWcxjyOpbbcu0SBIaxxVa4cZBKtLJAzks5tlxTqgaJpZM4TF1kc .

grabbou commented 6 years ago

Here's PR: https://github.com/facebook/react-native/pull/18721. I'll probably merge it today and once 0.55 is out, make a PR back to master to make sure it has all the fixes.

mk0y commented 6 years ago

This doesn't happen with React 16.3.1 and React Native 0.55.4.