Skip to content

Commit ad6005f

Browse files
Makar Kotlovkelset
authored andcommitted
Fix Xcode bundler in staging and release (#29477)
Summary: Revert "feat: improve monorepo support by removing redundant PROJECT_ROOT (#28354)" This reverts commit a8e8502. This commit a8e8502 somehow broke the bundler when making a staging or release build in Xcode that results in unresolved files and main.jsbundle nonexistance issue. I figured this out by replacing react-native-xcode.sh from RN v0.63.2 by the one from v0.62.2 where everything works just fine and then reverting the changes line by line. It seems like this pr will fix similar issues stated here https://stackoverflow.com/questions/62806319/main-jsbundle-does-not-exist-this-must-be-a-bug-with-main-jsbundle-issue-afte/62829256#62829256 and here #29205 ## Changelog [iOS] [Fixed] - fix "main.jsbundle does not exist" issue Pull Request resolved: #29477 Test Plan: With react-native-xcode.sh from RN v0.63.2 ![image](https://user-images.githubusercontent.com/32848434/88342113-7ce55d80-cd47-11ea-9dab-bf41ec6d6ab5.png) With my changes ![image](https://user-images.githubusercontent.com/32848434/88342376-f0876a80-cd47-11ea-9c08-96b892784da1.png) Reviewed By: sammy-SC Differential Revision: D23817847 Pulled By: hramos fbshipit-source-id: 4b729c1231d30e89073b2520aeadee944c84421c
1 parent 66c8cd3 commit ad6005f

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

scripts/react-native-xcode.sh

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,11 @@ case "$CONFIGURATION" in
5454
;;
5555
esac
5656

57-
# Setting up a project root was a workaround to enable support for non-standard
58-
# structures, including monorepos. Today, CLI supports that out of the box
59-
# and setting custom `PROJECT_ROOT` only makes it confusing.
60-
#
61-
# As a backwards-compatible change, I am leaving "PROJECT_ROOT" support for those
62-
# who already use it - it is likely a non-breaking removal.
63-
#
64-
# For new users, we default to $PWD - not changing things all.
65-
#
66-
# For context: https://github.com/facebook/react-native/commit/9ccde378b6e6379df61f9d968be6346ca6be7ead#commitcomment-37914902
67-
PROJECT_ROOT=${PROJECT_ROOT:-$PWD}
57+
# Path to react-native folder inside node_modules
58+
REACT_NATIVE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
59+
# The project should be located next to where react-native is installed
60+
# in node_modules.
61+
PROJECT_ROOT=${PROJECT_ROOT:-"$REACT_NATIVE_DIR/../.."}
6862

6963
cd "$PROJECT_ROOT" || exit
7064

@@ -102,9 +96,6 @@ if [[ ! -x node && -d ${HOME}/.anyenv/bin ]]; then
10296
fi
10397
fi
10498

105-
# Path to react-native folder inside node_modules
106-
REACT_NATIVE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
107-
10899
# check and assign NODE_BINARY env
109100
# shellcheck source=/dev/null
110101
source "$REACT_NATIVE_DIR/scripts/node-binary.sh"

0 commit comments

Comments
 (0)