Skip to content

fix(expo): resolve plugin config when registered as bare '@sentry/react-native' - #6543

Open
antonis wants to merge 4 commits into
mainfrom
fix/expo-upload-sourcemaps-bare-plugin-name
Open

fix(expo): resolve plugin config when registered as bare '@sentry/react-native'#6543
antonis wants to merge 4 commits into
mainfrom
fix/expo-upload-sourcemaps-bare-plugin-name

Conversation

@antonis

@antonis antonis commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

📢 Type of change

  • Bugfix

📜 Description

The @sentry/expo-upload-sourcemaps CLI resolves the Sentry org/project/url from the Expo config by scanning the plugins array. It only matched the plugin name @sentry/react-native/expo, so projects that register the plugin under the equally-valid bare name @sentry/react-native were not found — pluginConfig came back null and the script exited 1 with:

🐕 Fetching from expo config...
Could not fetch from expo config, trying sentry.properties files...

Both names resolve to the same plugin module (packages/core/app.plugin.js re-exports ./expo), so the uploader now matches either name.

💡 Motivation and Context

The bare @sentry/react-native plugin path is valid everywhere else in the SDK (config plugin, native build), so the uploader failing on it is an inconsistency, not user error. The only workaround today is registering as @sentry/react-native/expo or setting SENTRY_ORG/SENTRY_PROJECT env vars.

Fixes #6538

💚 How did you test it?

Verified in packages/core/app.plugin.js that both plugin names resolve to the same module, so reading props from a bare-name registration is correct. node --check on the modified cli.js. The change is additive — the existing @sentry/react-native/expo path is evaluated first and behaves identically, and exact-string matching avoids false positives on unrelated packages (e.g. @sentry/react-native-navigation).

📝 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.
  • All tests passing.
  • No breaking changes.

🔮 Next steps

…ct-native'

The Expo source map uploader only matched the '@sentry/react-native/expo'
plugin name, so projects that register the plugin under the equally-valid
bare name '@sentry/react-native' failed with "Could not fetch from expo
config" and exited 1. Both names resolve to the same plugin module via
app.plugin.js, so match either.

Fixes #6538

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

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).


  • fix(expo): resolve plugin config when registered as bare '@sentry/react-native' by antonis in #6543
  • chore(deps): update Android SDK to v8.51.0 by github-actions in #6539
  • chore(deps): update Sentry Android Gradle Plugin to v6.17.0 by github-actions in #6544
  • feat(core): Extend TurboModule instrumentation to legacy NativeModules by alwx in #6504
  • feat(ios): Introduce enableMetricKit option by alwx in #6540

🤖 This preview updates automatically when you update the PR.

@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor
Fails
🚫 Pull request is not ready for merge, please add the "ready-to-merge" label to the pull request

Generated by 🚫 dangerJS against 70c30a3

@antonis
antonis marked this pull request as ready for review July 30, 2026 14:33
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.

sentry-expo-upload-sourcemaps fails when plugin is registered as '@sentry/react-native' instead of '@sentry/react-native/expo'

1 participant