Skip to content

Conversation

@antonis
Copy link
Contributor

@antonis antonis commented Oct 8, 2025

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

Fixes TypeScript errors when using custom Metro configurations with Expo SDK 54 by relaxing getDefaultConfig types.

The getDefaultConfig option in SentryExpoConfigOptions now uses flexible typing to accommodate Metro bundler type differences between @expo/metro and the standalone metro package.

This fixes TypeScript errors when using custom Metro configurations with Expo SDK 54, where Metro type definitions have diverged from earlier versions.

💡 Motivation and Context

Fixes #5176

💚 How did you test it?

Manual with an Expo 54 project and the exact config from #5176

📝 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

@antonis antonis changed the title fix(metro): Fixes TypeScript errors when using custom Metro configurations with Expo SDK 54 fix(metro): Fixes TS errors with custom Metro configurations in Expo SDK 54 Oct 8, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Oct 8, 2025

Android (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 399.88 ms 438.30 ms 38.43 ms
Size 17.75 MiB 19.70 MiB 1.95 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
b3b5b0d 399.82 ms 419.20 ms 19.38 ms
a0b15d6 423.06 ms 437.77 ms 14.71 ms
2b89ce9 413.69 ms 442.58 ms 28.89 ms
bfe454a+dirty 573.44 ms 579.46 ms 6.02 ms
5c16cdc+dirty 423.48 ms 452.35 ms 28.88 ms
c4e097a 338.06 ms 439.36 ms 101.30 ms
6479fd5+dirty 412.95 ms 434.02 ms 21.07 ms
000da7a 454.46 ms 445.00 ms -9.46 ms
534ba8c 484.00 ms 499.93 ms 15.93 ms
7480abe+dirty 411.60 ms 405.81 ms -5.78 ms

App size

Revision Plain With Sentry Diff
b3b5b0d 17.75 MiB 19.68 MiB 1.94 MiB
a0b15d6 17.75 MiB 20.15 MiB 2.41 MiB
2b89ce9 17.75 MiB 19.68 MiB 1.94 MiB
bfe454a+dirty 17.75 MiB 19.69 MiB 1.94 MiB
5c16cdc+dirty 17.75 MiB 19.68 MiB 1.94 MiB
c4e097a 17.75 MiB 19.68 MiB 1.94 MiB
6479fd5+dirty 17.75 MiB 19.68 MiB 1.94 MiB
000da7a 17.75 MiB 19.68 MiB 1.94 MiB
534ba8c 17.75 MiB 20.15 MiB 2.41 MiB
7480abe+dirty 17.75 MiB 19.68 MiB 1.94 MiB

Previous results on branch: antonis/expo-metroconfig-ts

Startup times

Revision Plain With Sentry Diff
947815a+dirty 419.42 ms 421.19 ms 1.77 ms

App size

Revision Plain With Sentry Diff
947815a+dirty 17.75 MiB 19.70 MiB 1.95 MiB

@github-actions
Copy link
Contributor

github-actions bot commented Oct 8, 2025

Android (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 325.67 ms 342.15 ms 16.49 ms
Size 7.15 MiB 8.43 MiB 1.28 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
bfe454a+dirty 372.42 ms 424.52 ms 52.10 ms
5c16cdc+dirty 375.45 ms 426.62 ms 51.17 ms
6479fd5+dirty 393.06 ms 434.04 ms 40.98 ms
000da7a+dirty 347.89 ms 381.98 ms 34.09 ms
7480abe+dirty 363.80 ms 431.34 ms 67.54 ms
8a4ce6f+dirty 401.11 ms 381.92 ms -19.19 ms
8d89cc9+dirty 357.69 ms 415.79 ms 58.10 ms
9f211e3+dirty 371.00 ms 432.51 ms 61.51 ms
6fee48d+dirty 370.23 ms 427.86 ms 57.63 ms
955f2eb+dirty 388.13 ms 433.56 ms 45.44 ms

App size

Revision Plain With Sentry Diff
bfe454a+dirty 7.15 MiB 8.42 MiB 1.26 MiB
5c16cdc+dirty 7.15 MiB 8.41 MiB 1.26 MiB
6479fd5+dirty 7.15 MiB 8.41 MiB 1.26 MiB
000da7a+dirty 7.15 MiB 8.41 MiB 1.26 MiB
7480abe+dirty 7.15 MiB 8.41 MiB 1.26 MiB
8a4ce6f+dirty 7.15 MiB 8.41 MiB 1.26 MiB
8d89cc9+dirty 7.15 MiB 8.41 MiB 1.26 MiB
9f211e3+dirty 7.15 MiB 8.41 MiB 1.26 MiB
6fee48d+dirty 7.15 MiB 8.41 MiB 1.26 MiB
955f2eb+dirty 7.15 MiB 8.42 MiB 1.27 MiB

Previous results on branch: antonis/expo-metroconfig-ts

Startup times

Revision Plain With Sentry Diff
947815a+dirty 374.57 ms 425.91 ms 51.34 ms

App size

Revision Plain With Sentry Diff
947815a+dirty 7.15 MiB 8.43 MiB 1.27 MiB

@github-actions
Copy link
Contributor

github-actions bot commented Oct 8, 2025

iOS (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1230.33 ms 1234.59 ms 4.27 ms
Size 3.19 MiB 4.55 MiB 1.37 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
f70acbf+dirty 1239.00 ms 1242.53 ms 3.53 ms
c7f264b+dirty 1229.78 ms 1225.84 ms -3.94 ms
46da307+dirty 1213.45 ms 1207.96 ms -5.49 ms
20d5eaa+dirty 1224.67 ms 1223.16 ms -1.51 ms
c9e95bd+dirty 1205.83 ms 1207.38 ms 1.55 ms
1853710+dirty 1213.67 ms 1226.35 ms 12.67 ms
b3b5b0d+dirty 1235.16 ms 1238.61 ms 3.45 ms
8ece263+dirty 1206.90 ms 1211.45 ms 4.55 ms
bc9680d+dirty 1228.57 ms 1233.64 ms 5.07 ms
ba75c7c+dirty 1236.14 ms 1240.69 ms 4.55 ms

App size

Revision Plain With Sentry Diff
f70acbf+dirty 3.19 MiB 4.54 MiB 1.36 MiB
c7f264b+dirty 3.19 MiB 4.48 MiB 1.29 MiB
46da307+dirty 3.19 MiB 4.44 MiB 1.25 MiB
20d5eaa+dirty 3.19 MiB 4.38 MiB 1.19 MiB
c9e95bd+dirty 3.19 MiB 4.44 MiB 1.25 MiB
1853710+dirty 3.19 MiB 4.48 MiB 1.29 MiB
b3b5b0d+dirty 3.19 MiB 4.48 MiB 1.29 MiB
8ece263+dirty 3.19 MiB 4.48 MiB 1.29 MiB
bc9680d+dirty 3.19 MiB 4.38 MiB 1.19 MiB
ba75c7c+dirty 3.19 MiB 4.38 MiB 1.19 MiB

Previous results on branch: antonis/expo-metroconfig-ts

Startup times

Revision Plain With Sentry Diff
947815a+dirty 1225.80 ms 1224.69 ms -1.10 ms

App size

Revision Plain With Sentry Diff
947815a+dirty 3.19 MiB 4.55 MiB 1.36 MiB

@github-actions
Copy link
Contributor

github-actions bot commented Oct 8, 2025

iOS (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1214.09 ms 1204.36 ms -9.73 ms
Size 2.63 MiB 3.99 MiB 1.35 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
f70acbf+dirty 1235.71 ms 1243.14 ms 7.43 ms
c7f264b+dirty 1211.82 ms 1218.04 ms 6.22 ms
46da307+dirty 1217.08 ms 1224.16 ms 7.08 ms
20d5eaa+dirty 1231.12 ms 1226.00 ms -5.12 ms
c9e95bd+dirty 1240.19 ms 1246.33 ms 6.14 ms
1853710+dirty 1224.35 ms 1230.18 ms 5.84 ms
b3b5b0d+dirty 1227.71 ms 1239.50 ms 11.79 ms
8ece263+dirty 1217.29 ms 1213.35 ms -3.94 ms
bc9680d+dirty 1221.41 ms 1241.47 ms 20.06 ms
ba75c7c+dirty 1235.86 ms 1226.45 ms -9.41 ms

App size

Revision Plain With Sentry Diff
f70acbf+dirty 2.63 MiB 3.98 MiB 1.34 MiB
c7f264b+dirty 2.63 MiB 3.91 MiB 1.28 MiB
46da307+dirty 2.63 MiB 3.87 MiB 1.24 MiB
20d5eaa+dirty 2.63 MiB 3.81 MiB 1.18 MiB
c9e95bd+dirty 2.63 MiB 3.87 MiB 1.24 MiB
1853710+dirty 2.63 MiB 3.91 MiB 1.28 MiB
b3b5b0d+dirty 2.63 MiB 3.91 MiB 1.28 MiB
8ece263+dirty 2.63 MiB 3.91 MiB 1.28 MiB
bc9680d+dirty 2.63 MiB 3.81 MiB 1.18 MiB
ba75c7c+dirty 2.63 MiB 3.81 MiB 1.18 MiB

Previous results on branch: antonis/expo-metroconfig-ts

Startup times

Revision Plain With Sentry Diff
947815a+dirty 1224.92 ms 1226.18 ms 1.26 ms

App size

Revision Plain With Sentry Diff
947815a+dirty 2.63 MiB 3.98 MiB 1.35 MiB

@antonis antonis marked this pull request as ready for review October 8, 2025 12:41
Copy link
Collaborator

@lucas-zimerman lucas-zimerman left a comment

Choose a reason for hiding this comment

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

Looking good!
This is optional, but would it be possible to also include a type test to validates it's working with the new format and also the old ones? That could be done on a follow-up PR.

@antonis
Copy link
Contributor Author

antonis commented Oct 9, 2025

This is optional, but would it be possible to also include a type test to validates it's working with the new format and also the old ones? That could be done on a follow-up PR.

thank you @lucas-zimerman. I'll iterate on a new PR for this.

@antonis antonis merged commit 1bea095 into main Oct 9, 2025
168 of 173 checks passed
@antonis antonis deleted the antonis/expo-metroconfig-ts branch October 9, 2025 08:28
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.

Type mismatch with Expo's Metro config with custom Babel transformer

3 participants