Skip to content

Commit 4c637b0

Browse files
antonisclaude
authored andcommitted
docs(react-native): Document SENTRY_PROJECT_ROOT for monorepo setups (#17269)
## DESCRIBE YOUR PR Adds documentation for the new `SENTRY_PROJECT_ROOT` environment variable in the React Native manual setup guide. This env var allows monorepo users (NX, Turborepo) to override the project root in Xcode build phase scripts, fixing incorrect path resolution caused by symlinked `node_modules`. - Added `SENTRY_PROJECT_ROOT` to both the source maps and debug symbols upload env var sections - Added a `<Note>` explaining when to use it Companion SDK PR: getsentry/sentry-react-native#5961 Fixes: getsentry/sentry-react-native#2880 ## IS YOUR CHANGE URGENT? - [ ] Urgent deadline (GA date, etc.): - [ ] Other deadline: - [x] None: Not urgent, can wait up to 1 week+ ⚠️ Should be merged after getsentry/sentry-react-native#5961 is released ## PRE-MERGE CHECKLIST - [ ] Checked Vercel preview for correctness, including links - [ ] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs) --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d51cfcd commit 4c637b0

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

docs/platforms/react-native/manual-setup/manual-setup.mdx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,16 @@ export SENTRY_CLI_RN_XCODE_EXTRA_ARGS="--extra --flags"
8888
export SOURCE_MAP_PATH="path/to/source-maps" # From where collect-modules should read modules
8989
export SENTRY_COLLECT_MODULES="path/to/collect-modules.sh"
9090
export MODULES_PATHS="../node_modules,../my-custom-module"
91+
92+
export SENTRY_PROJECT_ROOT="/path/to/packages/mobile" # Override project root for monorepo setups
9193
```
9294

95+
<Alert>
96+
97+
If you're using a monorepo (for example, NX or Turborepo), the script may resolve the project root incorrectly due to symlinked `node_modules`. Set `SENTRY_PROJECT_ROOT` to the absolute path of your React Native package to fix build failures caused by incorrect path resolution.
98+
99+
</Alert>
100+
93101
By default, uploading of source maps for debug simulator builds is disabled for speed reasons. If you want to generate source maps for debug builds, you can pass `--allow-fetch` as a parameter to `SENTRY_CLI_RN_XCODE_EXTRA_ARGS` in the above mentioned script.
94102

95103
### Configure Automatic Debug Symbols Upload
@@ -110,6 +118,8 @@ export SENTRY_INCLUDE_NATIVE_SOURCES=true # Upload native iOS sources
110118
export SENTRY_CLI_EXECUTABLE="path/to/@sentry/cli/bin/sentry-cli"
111119
export SENTRY_CLI_EXTRA_ARGS="--extra --flags" # Extra arguments for sentry-cli in all build phases
112120
export SENTRY_CLI_DEBUG_FILES_UPLOAD_EXTRA_ARGS="--extra --flags"
121+
122+
export SENTRY_PROJECT_ROOT="/path/to/packages/mobile" # Override project root for monorepo setups
113123
```
114124

115125
For more information about what options to use in `SENTRY_CLI_DEBUG_FILES_UPLOAD_EXTRA_ARGS` visit the [Sentry CLI Apple Debug Symbols](/platforms/apple/dsym/#sentry-cli) documentation.

0 commit comments

Comments
 (0)