Skip to content

feat(core): Warn when multiple versions of Sentry JS SDK are detected#6269

Merged
antonis merged 5 commits into
mainfrom
antonis/warn-multiple-sdk-versions
Jun 12, 2026
Merged

feat(core): Warn when multiple versions of Sentry JS SDK are detected#6269
antonis merged 5 commits into
mainfrom
antonis/warn-multiple-sdk-versions

Conversation

@antonis

@antonis antonis commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

Adds a dev-only runtime check during Sentry.init() that detects when multiple versions of @sentry/core are loaded in the same application

💡 Motivation and Context

Closes #3769

💚 How did you test it?

  • Unit tests covering: single version (no warn), two versions, 3+ versions, version key false positive, missing carrier, production skip, and error resilience

📝 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

Adds a dev-only runtime check during `Sentry.init()` that inspects
the global `__SENTRY__` carrier for multiple SDK version keys. If
found, logs a warning via `debug.warn` to help users diagnose
version mismatch issues in monorepos.

Closes #3769

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

github-actions Bot commented Jun 9, 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).


  • feat(core): Warn when multiple versions of Sentry JS SDK are detected by antonis in #6269

🤖 This preview updates automatically when you update the PR.

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against a863084

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 7bb9d60. Configure here.

@antonis antonis marked this pull request as ready for review June 9, 2026 15:09
Comment thread CHANGELOG.md Outdated
Comment thread packages/core/src/js/utils/sdkVersionCheck.ts Outdated
antonis and others added 2 commits June 12, 2026 10:08
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@antonis antonis requested a review from lucas-zimerman June 12, 2026 08:11
@lucas-zimerman lucas-zimerman added the ready-to-merge Triggers the full CI test suite label Jun 12, 2026

@lucas-zimerman lucas-zimerman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@github-actions

Copy link
Copy Markdown
Contributor

Android (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 432.94 ms 466.22 ms 33.28 ms
Size 48.30 MiB 53.57 MiB 5.26 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
15d4514+dirty 406.77 ms 428.06 ms 21.29 ms
038a6d7+dirty 524.82 ms 531.92 ms 7.10 ms
4b87b12+dirty 421.82 ms 413.60 ms -8.22 ms
5ee78d6+dirty 551.80 ms 568.27 ms 16.47 ms
853723c+dirty 405.54 ms 440.08 ms 34.54 ms
4966363+dirty 400.04 ms 431.08 ms 31.04 ms
7ff4d0f+dirty 413.81 ms 450.64 ms 36.83 ms
bc0d8cf+dirty 412.37 ms 466.26 ms 53.89 ms
ef27341+dirty 412.94 ms 443.98 ms 31.04 ms
2c735cc+dirty 414.09 ms 438.47 ms 24.38 ms

App size

Revision Plain With Sentry Diff
15d4514+dirty 48.30 MiB 53.60 MiB 5.30 MiB
038a6d7+dirty 48.30 MiB 53.60 MiB 5.30 MiB
4b87b12+dirty 43.75 MiB 48.14 MiB 4.39 MiB
5ee78d6+dirty 48.30 MiB 53.58 MiB 5.28 MiB
853723c+dirty 48.30 MiB 53.58 MiB 5.28 MiB
4966363+dirty 48.30 MiB 53.54 MiB 5.24 MiB
7ff4d0f+dirty 48.30 MiB 53.60 MiB 5.30 MiB
bc0d8cf+dirty 48.30 MiB 53.48 MiB 5.18 MiB
ef27341+dirty 48.30 MiB 53.54 MiB 5.24 MiB
2c735cc+dirty 43.75 MiB 48.08 MiB 4.33 MiB

@github-actions

Copy link
Copy Markdown
Contributor

iOS (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 3865.53 ms 1226.39 ms -2639.14 ms
Size 5.15 MiB 6.69 MiB 1.53 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
7ac3378+dirty 1213.37 ms 1218.15 ms 4.78 ms
1122a96+dirty 3823.10 ms 1218.64 ms -2604.46 ms
5748023+dirty 3840.49 ms 1227.43 ms -2613.05 ms
b0d3373+dirty 3831.75 ms 1227.29 ms -2604.46 ms
6177334+dirty 3834.85 ms 1217.58 ms -2617.28 ms
3ce5254+dirty 1219.93 ms 1221.90 ms 1.96 ms
5569641+dirty 3839.22 ms 1231.30 ms -2607.91 ms
5257d80+dirty 3854.39 ms 1234.28 ms -2620.11 ms
882f8ae+dirty 3840.30 ms 1224.41 ms -2615.88 ms
5c1e987+dirty 1204.30 ms 1222.15 ms 17.85 ms

App size

Revision Plain With Sentry Diff
7ac3378+dirty 3.38 MiB 4.76 MiB 1.38 MiB
1122a96+dirty 5.15 MiB 6.68 MiB 1.53 MiB
5748023+dirty 5.15 MiB 6.68 MiB 1.53 MiB
b0d3373+dirty 5.15 MiB 6.68 MiB 1.53 MiB
6177334+dirty 5.15 MiB 6.68 MiB 1.53 MiB
3ce5254+dirty 3.38 MiB 4.76 MiB 1.38 MiB
5569641+dirty 5.15 MiB 6.67 MiB 1.51 MiB
5257d80+dirty 5.15 MiB 6.69 MiB 1.54 MiB
882f8ae+dirty 5.15 MiB 6.70 MiB 1.54 MiB
5c1e987+dirty 3.38 MiB 4.73 MiB 1.35 MiB

@sentry

sentry Bot commented Jun 12, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
Sentry RN io.sentry.reactnative.sample 8.14.0 (91) Release

⚙️ sentry-react-native Build Distribution Settings

@github-actions

Copy link
Copy Markdown
Contributor

iOS (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 3835.96 ms 1218.66 ms -2617.30 ms
Size 5.15 MiB 6.69 MiB 1.53 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
7ac3378+dirty 1202.35 ms 1198.31 ms -4.04 ms
1122a96+dirty 3839.17 ms 1219.23 ms -2619.93 ms
5748023+dirty 3844.74 ms 1225.49 ms -2619.26 ms
b0d3373+dirty 3842.49 ms 1218.49 ms -2624.00 ms
6177334+dirty 3851.52 ms 1226.23 ms -2625.29 ms
3ce5254+dirty 1217.70 ms 1224.69 ms 6.99 ms
5569641+dirty 3824.35 ms 1210.78 ms -2613.57 ms
5257d80+dirty 3845.40 ms 1226.21 ms -2619.19 ms
882f8ae+dirty 3842.51 ms 1230.40 ms -2612.11 ms
5c1e987+dirty 1208.43 ms 1220.72 ms 12.29 ms

App size

Revision Plain With Sentry Diff
7ac3378+dirty 3.38 MiB 4.76 MiB 1.38 MiB
1122a96+dirty 5.15 MiB 6.68 MiB 1.53 MiB
5748023+dirty 5.15 MiB 6.68 MiB 1.53 MiB
b0d3373+dirty 5.15 MiB 6.68 MiB 1.53 MiB
6177334+dirty 5.15 MiB 6.68 MiB 1.53 MiB
3ce5254+dirty 3.38 MiB 4.76 MiB 1.38 MiB
5569641+dirty 5.15 MiB 6.67 MiB 1.51 MiB
5257d80+dirty 5.15 MiB 6.69 MiB 1.54 MiB
882f8ae+dirty 5.15 MiB 6.70 MiB 1.54 MiB
5c1e987+dirty 3.38 MiB 4.73 MiB 1.35 MiB

@github-actions

Copy link
Copy Markdown
Contributor

Android (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 406.32 ms 452.38 ms 46.06 ms
Size 48.30 MiB 53.57 MiB 5.26 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
15d4514+dirty 413.63 ms 449.62 ms 35.99 ms
df5d108+dirty 434.82 ms 447.39 ms 12.57 ms
038a6d7+dirty 499.02 ms 527.68 ms 28.66 ms
5ee78d6+dirty 411.18 ms 437.83 ms 26.65 ms
4953e94+dirty 398.80 ms 431.81 ms 33.01 ms
853723c+dirty 415.82 ms 460.94 ms 45.12 ms
4966363+dirty 415.67 ms 448.60 ms 32.93 ms
7ff4d0f+dirty 403.38 ms 427.06 ms 23.68 ms
ef27341+dirty 519.02 ms 553.42 ms 34.40 ms
a50b33d+dirty 353.21 ms 398.48 ms 45.27 ms

App size

Revision Plain With Sentry Diff
15d4514+dirty 48.30 MiB 53.60 MiB 5.30 MiB
df5d108+dirty 43.94 MiB 48.94 MiB 5.00 MiB
038a6d7+dirty 48.30 MiB 53.60 MiB 5.30 MiB
5ee78d6+dirty 48.30 MiB 53.58 MiB 5.28 MiB
4953e94+dirty 43.94 MiB 48.94 MiB 5.00 MiB
853723c+dirty 48.30 MiB 53.58 MiB 5.28 MiB
4966363+dirty 48.30 MiB 53.54 MiB 5.24 MiB
7ff4d0f+dirty 48.30 MiB 53.60 MiB 5.30 MiB
ef27341+dirty 48.30 MiB 53.54 MiB 5.24 MiB
a50b33d+dirty 43.94 MiB 48.94 MiB 5.00 MiB

@antonis antonis merged commit 0bd8916 into main Jun 12, 2026
112 of 118 checks passed
@antonis antonis deleted the antonis/warn-multiple-sdk-versions branch June 12, 2026 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge Triggers the full CI test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Warn when multiple version of Sentry's JS SDK are used in RN project

2 participants