WIP: feat(expo): Warn when prebuilt native projects are missing Sentry config#5984
Draft
WIP: feat(expo): Warn when prebuilt native projects are missing Sentry config#5984
Conversation
Contributor
Semver Impact of This PR⚪ None (no version bump detected) 📋 Changelog PreviewThis is how your changes will appear in the changelog.
Plus 6 more 🤖 This preview updates automatically when you update the PR. |
Contributor
Instructions and example for changelogPlease add an entry to Example: ## Unreleased
### Features
- Warn when prebuilt native projects are missing Sentry config ([#5984](https://github.com/getsentry/sentry-react-native/pull/5984))If none of the above apply, you can opt out of this check by adding |
When using the Sentry Expo Plugin with prebuilt native projects, users need to run `npx expo prebuild --clean` to apply the native changes. Without this step, source maps upload and native crash reporting won't work correctly. This adds a check in `getSentryExpoConfig()` that runs at Metro startup and inspects existing ios/android directories for Sentry markers: - iOS: looks for `sentry-xcode` or `Upload Debug Symbols to Sentry` in the pbxproj file - Android: looks for `sentry.gradle` in app/build.gradle The check only runs for Expo projects (detected via package.json) and is fully wrapped in try/catch to never crash Metro startup. Closes #4640
5c0910a to
42d7ec5
Compare
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.
📢 Type of change
📜 Description
Adds a Metro startup check that warns Expo users when their prebuilt native projects (
ios/andandroid/) are missing Sentry configuration.Fixes #4640
Users who add the Sentry Expo Plugin after already running
expo prebuildget no indication that their native projects are stale. This leads to confusing issues where source maps upload and native crash reporting silently fail.💚 How did you test it?
yarn build)oxlint)📝 Checklist
sendDefaultPIIis enabled