Repository navigation
Conversation
Semver Impact of This PR⚪ None (no version bump detected) 📋 Changelog PreviewThis is how your changes will appear in the changelog.
🤖 This preview updates automatically when you update the PR. |
|
Inject the module metadata of @sentry/bundler-plugins as a virtual premodule, so thirdPartyErrorFilterIntegration can find the frames of the application. Export thirdPartyErrorFilterIntegration. Fixes #6858 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
e1bd076 to
e53db48
Compare
Add a test that shows that thirdPartyErrorFilterIntegration applies the injected module metadata on ReactNativeClient. Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 4e05634. Configure here.
| unstable_beforeAssetSerializationPlugins: [ | ||
| ...(options.unstable_beforeAssetSerializationPlugins || []), | ||
| ...((options.injectReleaseForWeb ?? true) ? [unstableReleaseConstantsPlugin(projectRoot)] : []), | ||
| ...(moduleMetadata ? [unstableBeforeAssetSerializationModuleMetadataPlugin(moduleMetadata)] : []), |
There was a problem hiding this comment.
Expo skips development metadata injection
Medium Severity
getSentryExpoConfig only registers unstableBeforeAssetSerializationModuleMetadataPlugin and never prepends the metadata module onto serializer preModules. Expo applies that plugin when exporting chunks, while expo start uses baseJSBundle with the incoming premodules and does not run those plugins. Development Expo bundles therefore never define _sentryModuleMetadata, so thirdPartyErrorFilterIntegration still treats every frame as third-party — the failure this change is meant to fix, including Expo web where browser-extension filtering is the documented use case. withSentryConfig already injects through createSentryMetroSerializer before the hot/dev early return; Expo has no equivalent wrapper.
Additional Locations (2)
Triggered by project rule: PR Review Guidelines for Cursor Bot
Reviewed by Cursor Bugbot for commit 4e05634. Configure here.


📢 Type of change
📜 Description
This PR adds the
applicationKeyandmoduleMetadataoptions towithSentryConfigandgetSentryExpoConfig. The SDK injects the same module metadata snippet as@sentry/bundler-pluginsas a virtual premodule, also in development bundles and in each Expo chunk. The PR also exportsthirdPartyErrorFilterIntegrationfrom@sentry/react-native.💡 Motivation and Context
Without module metadata,
thirdPartyErrorFilterIntegrationsees every frame as third-party code, so adrop-…behavior drops all events. Fixes #6858.The snippet is a local copy, and a test pins it to
generateModuleMetadataInjectorCode. Only the object form ofmoduleMetadatais supported, because Metro does not know the org, project, or release.💚 How did you test it?
I added unit tests for the snippet, the metadata assembly, the serializer, the Expo plugin, and the Metro config options. All SDK and tool tests pass.
📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
Document the new options and the integration in the React Native docs.
🤖 Generated with Claude Code