Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix packager start in 0.58 #23160

Merged
merged 1 commit into from
Jan 25, 2019

Conversation

dulmandakh
Copy link
Contributor

@dulmandakh dulmandakh commented Jan 25, 2019

This PR fixes packager during react-native run-ios and react-native run-android.

On reddit and discord many developers say that react-native run-ios failing on 0.58. But I found that react-native start works just fine. So did some investigation and found that if check is false when react-native run-ios but true when react-native start.

if (require.main === module) {

It checks if script is run from shell, then starts the packager. Also found that react-native start calls this react-natvie/local-cli/cli.js directly and check is true. And dug little further to find that packager.sh is calling react-native/cli.js which imports react-native/local-cli/cli.js, therefore check is false.

@dulmandakh dulmandakh requested review from hramos and grabbou January 25, 2019 14:09
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jan 25, 2019
@pull-bot
Copy link

Warnings
⚠️

📋 Test Plan - This PR appears to be missing a Test Plan.

⚠️

📋 Release Notes - This PR appears to be missing Release Notes.

⚠️

❔ Base Branch - The base branch for this PR is something other than master. Are you sure you want to merge these changes into a stable release? If you are interested in backporting updates to an older release, the suggested approach is to land those changes on master first and then cherry-pick the commits into the branch for that release. The Releases Guide has more information.

Generated by 🚫 dangerJS

Copy link
Contributor

@kelset kelset left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@react-native-bot react-native-bot added the Tech: Bundler 📦 This issue is related to the bundler (Metro, Haul, etc) used. label Jan 25, 2019
@grabbou
Copy link
Contributor

grabbou commented Jan 25, 2019

It's interesting this is not present on 0.57, even though there are no changes to the files as far as I am aware.

@cpojer
Copy link
Contributor

cpojer commented Jan 26, 2019

I don't really get why this was failing? The top level cli.js is the same as this one :O

@dulmandakh
Copy link
Contributor Author

local-cli has a check that if it's run from cli or imported as a module, and it'll run it's called from cli. top level cli.js requires it, so the check is failed and not run.

if (require.main === module) {

@cpojer
Copy link
Contributor

cpojer commented Jan 28, 2019

Ah, got it. Sorry I didn't realize it was used that way.

@cpojer
Copy link
Contributor

cpojer commented Jan 28, 2019

I'd like to find out why we didn't discover this during testing. Since this is basic functionality, we should ensure it never breaks. cc @grabbou

@dulmandakh dulmandakh deleted the stable-fix-packager branch February 22, 2019 14:22
t-nanava pushed a commit to microsoft/react-native-macos that referenced this pull request Jun 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Tech: Bundler 📦 This issue is related to the bundler (Metro, Haul, etc) used.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants