Don't validate ENTRY_FILE in react-native-xcode.sh#32762
Closed
janicduplessis wants to merge 2 commits into
Closed
Don't validate ENTRY_FILE in react-native-xcode.sh#32762janicduplessis wants to merge 2 commits into
janicduplessis wants to merge 2 commits into
Conversation
Base commit: a0e6ffe |
Base commit: a0e6ffe |
|
Hi @janicduplessis thanks for this, we were having the same issue here. Will it be possible to merge this? |
cipolleschi
approved these changes
Jun 10, 2022
Contributor
|
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Collaborator
|
This pull request was successfully merged by @janicduplessis in 780fe80. When will my fix make it into a release? | Upcoming Releases |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Reverts #29012
It is not really possible to properly validate if ENTRY_FILE exists since it is resolved by metro, and the server is not always running from the app root, like in a monorepo with multiple RN apps running on the same metro server.
In my case I run metro on the repo root and entry file will be something like
apps/app/index.js.-f "$ENTRY_FILE"will fail since the script is run from the project folder (PROJECT_ROOT, in my case theapps/appfolder, so it tries to resolveapps/app/apps/app/index.js).I don't think this check is actually useful since metro will report the error if the entry file is invalid (fixed in #30150). The error is not as user friendly, but I think it is still fine. Maybe it could be improved in metro.
Changelog
[iOS] [Fixed] - Don't validate ENTRY_FILE in react-native-xcode.sh
Test Plan
Before
After if file is actually missing
After if file exists, builds successfully.