Skip to content

Commit c07f23f

Browse files
authored
fix: Run Scripts of react-native (#827)
1 parent 4c259a2 commit c07f23f

File tree

1 file changed

+47
-3
lines changed

1 file changed

+47
-3
lines changed

src/collections/_documentation/clients/react-native/manual-setup.md

Lines changed: 47 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,21 @@ symbols for all build variants.
7878

7979
Note that uploading of debug simulator builds by default is disabled for speed reasons. If you do want to also generate debug symbols for debug builds you can pass `--allow-fetch` as a parameter to `react-native-xcode` in the above mentioned build phase.
8080

81-
### Using node with nvm
81+
### Using node with nvm or notion
8282

83-
If you are using nvm, Xcode seems to have problems locating the default node binary. In that case you should change the scripts to this:
83+
If you are using nvm or notion, Xcode seems to have problems locating the default node binary. In that case you should change the scripts to this:
84+
85+
Build failure in Xcode looks something like:
86+
87+
```bash
88+
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.62.dylib
89+
Referenced from: /usr/local/bin/node
90+
Reason: image not found
91+
```
92+
93+
Change the run scripts in Xcode to:
94+
95+
#### Bundle React Native code and images
8496

8597
```bash
8698
# First set the path to sentry.properties
@@ -100,12 +112,44 @@ if [[ -x "$HOME/.nodenv/bin/nodenv" ]]; then
100112
eval "$("$HOME/.nodenv/bin/nodenv" init -)"
101113
fi
102114

115+
# Trying notion
116+
if [ -z "$NODE_BINARY" ]; then
117+
if [[ -s "$HOME/.notion/bin/node" ]]; then
118+
export NODE_BINARY="$HOME/.notion/bin/node"
119+
fi
120+
fi
121+
103122
[ -z "$NODE_BINARY" ] && export NODE_BINARY="node"
104123

105124
# Run sentry cli script to upload debug symbols
106125
$NODE_BINARY ../node_modules/@sentry/cli/bin/sentry-cli upload-dif "$DWARF_DSYM_FOLDER_PATH"
126+
```
127+
128+
#### Upload Debug Symbols to Sentry
129+
130+
```bash
131+
# Setup nvm and set node
132+
[ -z "$NVM_DIR" ] && export NVM_DIR="$HOME/.nvm"
133+
134+
if [[ -s "$HOME/.nvm/nvm.sh" ]]; then
135+
. "$HOME/.nvm/nvm.sh"
136+
elif [[ -x "$(command -v brew)" && -s "$(brew --prefix nvm)/nvm.sh" ]]; then
137+
. "$(brew --prefix nvm)/nvm.sh"
138+
fi
139+
140+
# Set up the nodenv node version manager if present
141+
if [[ -x "$HOME/.nodenv/bin/nodenv" ]]; then
142+
eval "$("$HOME/.nodenv/bin/nodenv" init -)"
143+
fi
107144

108-
# OR
145+
# Trying notion
146+
if [ -z "$NODE_BINARY" ]; then
147+
if [[ -s "$HOME/.notion/bin/node" ]]; then
148+
export NODE_BINARY="$HOME/.notion/bin/node"
149+
fi
150+
fi
151+
152+
[ -z "$NODE_BINARY" ] && export NODE_BINARY="node"
109153

110154
$NODE_BINARY ../node_modules/@sentry/cli/bin/sentry-cli react-native xcode \
111155
../node_modules/react-native/scripts/react-native-xcode.sh

0 commit comments

Comments
 (0)