Skip to content

WIP: feat(expo): Warn when prebuilt native projects are missing Sentry config#5984

Draft
alwx wants to merge 1 commit intomainfrom
alwx/expo-native-rebuild-warning
Draft

WIP: feat(expo): Warn when prebuilt native projects are missing Sentry config#5984
alwx wants to merge 1 commit intomainfrom
alwx/expo-native-rebuild-warning

Conversation

@alwx
Copy link
Copy Markdown
Contributor

@alwx alwx commented Apr 13, 2026

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

Adds a Metro startup check that warns Expo users when their prebuilt native projects (ios/ and android/) are missing Sentry configuration.

Fixes #4640

Users who add the Sentry Expo Plugin after already running expo prebuild get 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?

  • Verified build passes (yarn build)
  • Verified lint passes (oxlint)
  • TODO: Add unit tests

📝 Checklist

  • I added tests to verify changes
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • All tests passing
  • No breaking changes

@alwx alwx self-assigned this Apr 13, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 13, 2026

Semver Impact of This PR

None (no version bump detected)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


  • WIP: feat(expo): Warn when prebuilt native projects are missing Sentry config by alwx in #5984
  • ci: Gate size analysis on ready-to-merge label for PRs by antonis in #5963
  • chore(deps): update Android SDK to v8.38.0 by github-actions in #5971
  • chore(deps): update Sentry Android Gradle Plugin to v6.4.0 by github-actions in #5974
  • chore(deps): update Cocoa SDK to v9.10.0 by github-actions in #5972
  • chore(deps): update JavaScript SDK to v10.48.0 by github-actions in #5975
  • chore(deps): bump actions/github-script from 8 to 9 by dependabot in #5980
  • chore(deps): bump actions/create-github-app-token from 3.0.0 to 3.1.1 by dependabot in #5979
  • chore(deps): update Bundler Plugins to v5.2.0 by github-actions in #5968
  • chore(deps): bump axios from 1.13.5 to 1.15.0 by dependabot in #5978
  • chore(deps): bump addressable from 2.8.7 to 2.9.0 in /performance-tests by dependabot in #5969
  • chore(deps): bump basic-ftp from 5.2.0 to 5.2.2 by dependabot in #5977
  • fix(profiling): Fix app start transaction profile timestamp offset by antonis in #5962
  • fix(android): Use componentStack as fallback for missing error stack traces by antonis in #5965
  • chore(deps): bump addressable from 2.8.7 to 2.9.0 in /samples/react-native-macos by dependabot in #5967
  • chore(deps): bump addressable from 2.8.7 to 2.9.0 in /samples/react-native by dependabot in #5966
  • fix(ios): Add SENTRY_PROJECT_ROOT env var for monorepo support by antonis in #5961
  • feat(ios): Add attachAllThreads option by antonis in #5960
  • fix(core): Lazy-load Metro internal modules to prevent Expo 55 import errors by lucas-zimerman in #5958
  • chore(deps): update Cocoa SDK to v9.9.0 by github-actions in #5956
  • chore(deps): update Maestro to v2.4.0 by github-actions in #5955
  • Feat: Fallback to stacktrace parsing by lucas-zimerman in #5946
  • fix(ci): Bump Node to 22 in size-analysis and testflight workflows by antonis in #5954
  • feat(playground): Open Sentry in desktop browser from Expo apps by antonis in #5947

Plus 6 more


🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 13, 2026

Fails
🚫 Pull request is not ready for merge, please add the "ready-to-merge" label to the pull request
🚫 Please consider adding a changelog entry for the next release.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

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 #skip-changelog to the PR description or adding a skip-changelog label.

Generated by 🚫 dangerJS against 42d7ec5

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
@alwx alwx force-pushed the alwx/expo-native-rebuild-warning branch from 5c0910a to 42d7ec5 Compare April 13, 2026 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Expo] Explicitly inform user about need of rebuilding the native project when using Sentry Expo Plugin

1 participant