Skip to content

Fix how bundle IDs are getting defined for individual bundles#5341

Closed
alwx wants to merge 0 commit intomainfrom
alwx/bugfix/serializer-fix
Closed

Fix how bundle IDs are getting defined for individual bundles#5341
alwx wants to merge 0 commit intomainfrom
alwx/bugfix/serializer-fix

Conversation

@alwx
Copy link
Contributor

@alwx alwx commented Nov 6, 2025

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

Fixes #5250

Here is the root cause:

  • Lazy-loaded chunks are serialized separately with their own preModules array
  • The debug ID module is only added to the main bundle's preModules
  • When processing a lazy chunk, determineDebugIdFromBundleSource() can't find the debug ID → returns null
  • The code throws an error instead of handling this gracefully

The solution is to generate bundle IDs for individual code chunks.
That needs to be done because when Metro 0.83.2 stopped importing BabelSourceMapSegment from @babel/generator and defined it locally, it subtly changed the source map output format.

📝 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

🔮 Next steps

@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 2025

Fails
🚫 Please consider adding a changelog entry for the next release.
Warnings
⚠️

🤖 Replay Stubs Check

No changes detected in replay-stubs.jar

All file contents are identical (verified by SHA-256 hash comparison).

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

### Fixes

- Fix how bundle IDs are getting defined for individual bundles ([#5341](https://github.com/getsentry/sentry-react-native/pull/5341))

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 c922d88

@alwx alwx closed this Nov 6, 2025
@alwx alwx force-pushed the alwx/bugfix/serializer-fix branch from c922d88 to d1bfbde Compare November 6, 2025 16:35
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.

[react native 0.82.0] Debug ID was not found in the bundle. Call options.sentryBundleCallback if you are using a custom serializer.

1 participant