-
Notifications
You must be signed in to change notification settings - Fork 24.6k
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
fix packager start in 0.58 #23160
Conversation
Generated by 🚫 dangerJS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
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. |
I don't really get why this was failing? The top level cli.js is the same as this one :O |
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) { |
Ah, got it. Sorry I didn't realize it was used that way. |
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 |
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.
react-native/local-cli/cli.js
Line 23 in 57ad197
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.