Skip to content

fix(ios): print bundler output line-by-line on build failure#5699

Merged
antonis merged 2 commits intomainfrom
antonis/issue-5685
Feb 24, 2026
Merged

fix(ios): print bundler output line-by-line on build failure#5699
antonis merged 2 commits intomainfrom
antonis/issue-5685

Conversation

@antonis
Copy link
Copy Markdown
Contributor

@antonis antonis commented Feb 23, 2026

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

When a JS syntax or import error causes the Metro bundler to fail, the build output was printed as a single unreadable string, hiding the actual error behind a generic Sentry source maps message.

Print the captured output line-by-line (consistent with the success path) and before the Sentry guidance, so the real bundler error is visible in Xcode's Issues navigator.

💡 Motivation and Context

Fixes #5689

💚 How did you test it?

Manual

📝 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

#skip-changelog

When a JS syntax or import error causes the Metro bundler to fail,
the build output was printed as a single unreadable string, hiding
the actual error behind a generic Sentry source maps message.

Print the captured output line-by-line (consistent with the success
path) and before the Sentry guidance, so the real bundler error is
visible in Xcode's Issues navigator.

Fixes #5689

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 23, 2026

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


This PR will not appear in the changelog.


🤖 This preview updates automatically when you update the PR.

@antonis antonis added the ready-to-merge Triggers the full CI test suite label Feb 23, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 23, 2026

Android (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 457.39 ms 495.08 ms 37.69 ms
Size 43.75 MiB 48.46 MiB 4.71 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
ff5a06a+dirty 405.97 ms 439.24 ms 33.27 ms
8ff81c0+dirty 574.58 ms 611.44 ms 36.86 ms
8d0a325+dirty 406.48 ms 415.02 ms 8.54 ms
6c36ba5+dirty 385.48 ms 442.36 ms 56.88 ms
817b2c1+dirty 471.91 ms 489.55 ms 17.64 ms
136effd+dirty 398.57 ms 494.91 ms 96.34 ms
95aaf8a 437.89 ms 419.45 ms -18.44 ms
01d24f6+dirty 362.50 ms 362.23 ms -0.27 ms
6bb8427+dirty 360.48 ms 400.04 ms 39.56 ms
1853710 555.47 ms 556.59 ms 1.12 ms

App size

Revision Plain With Sentry Diff
ff5a06a+dirty 43.75 MiB 48.05 MiB 4.29 MiB
8ff81c0+dirty 43.75 MiB 48.05 MiB 4.29 MiB
8d0a325+dirty 43.75 MiB 48.08 MiB 4.33 MiB
6c36ba5+dirty 43.75 MiB 48.41 MiB 4.66 MiB
817b2c1+dirty 43.75 MiB 48.40 MiB 4.64 MiB
136effd+dirty 43.75 MiB 47.99 MiB 4.23 MiB
95aaf8a 17.75 MiB 19.68 MiB 1.93 MiB
01d24f6+dirty 17.75 MiB 19.74 MiB 2.00 MiB
6bb8427+dirty 43.75 MiB 48.08 MiB 4.33 MiB
1853710 17.75 MiB 19.68 MiB 1.94 MiB

@antonis
Copy link
Copy Markdown
Contributor Author

antonis commented Feb 23, 2026

@sentry review

@antonis antonis marked this pull request as ready for review February 23, 2026 15:52
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

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.

else
echo "$SENTRY_XCODE_COMMAND_OUTPUT" | awk '{print "error: sentry-cli - " $0}'
echo "error: sentry-cli - To disable source maps auto upload, set SENTRY_DISABLE_AUTO_UPLOAD=true in your environment variables. Or to allow failing upload, set SENTRY_ALLOW_FAILURE=true"
echo "error: sentry-cli - $SENTRY_XCODE_COMMAND_OUTPUT"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

echo may swallow bundler output

Medium Severity

Using echo "$SENTRY_XCODE_COMMAND_OUTPUT" | awk ... can misprint or suppress output when the captured output begins with -n/-e (option-like prefixes) because echo option parsing is shell-dependent. This can hide the underlying Metro/sentry-cli failure again, especially on the error path where visibility is most important.

Fix in Cursor Fix in Web

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is correct in theory but this pattern is already used (see line 57 above)

@github-actions
Copy link
Copy Markdown
Contributor

iOS (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1209.52 ms 1211.67 ms 2.15 ms
Size 3.38 MiB 4.78 MiB 1.40 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
ec14be7+dirty 1234.64 ms 1245.54 ms 10.90 ms
b3b5b0d+dirty 1227.71 ms 1239.50 ms 11.79 ms
af9331b+dirty 1233.61 ms 1230.50 ms -3.11 ms
8a868fe+dirty 1221.50 ms 1230.78 ms 9.28 ms
90afdd3+dirty 1233.90 ms 1240.90 ms 7.00 ms
7b02433+dirty 1209.39 ms 1210.90 ms 1.51 ms
8d89cc9+dirty 1222.92 ms 1239.43 ms 16.51 ms
f17e051+dirty 1193.71 ms 1223.51 ms 29.80 ms
cd5f27f+dirty 1214.87 ms 1218.72 ms 3.85 ms
e2fa43d+dirty 1216.04 ms 1232.65 ms 16.61 ms

App size

Revision Plain With Sentry Diff
ec14be7+dirty 2.63 MiB 3.98 MiB 1.34 MiB
b3b5b0d+dirty 2.63 MiB 3.91 MiB 1.28 MiB
af9331b+dirty 2.63 MiB 3.91 MiB 1.28 MiB
8a868fe+dirty 3.38 MiB 4.60 MiB 1.22 MiB
90afdd3+dirty 2.63 MiB 3.99 MiB 1.35 MiB
7b02433+dirty 3.38 MiB 4.60 MiB 1.22 MiB
8d89cc9+dirty 2.63 MiB 3.96 MiB 1.33 MiB
f17e051+dirty 3.41 MiB 4.67 MiB 1.25 MiB
cd5f27f+dirty 3.38 MiB 4.78 MiB 1.39 MiB
e2fa43d+dirty 2.63 MiB 3.81 MiB 1.18 MiB

@github-actions
Copy link
Copy Markdown
Contributor

iOS (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1225.69 ms 1228.48 ms 2.78 ms
Size 3.38 MiB 4.78 MiB 1.40 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
ec14be7+dirty 1229.62 ms 1230.53 ms 0.91 ms
b3b5b0d+dirty 1235.16 ms 1238.61 ms 3.45 ms
af9331b+dirty 1230.08 ms 1233.24 ms 3.16 ms
8a868fe+dirty 1206.85 ms 1215.04 ms 8.19 ms
90afdd3+dirty 1216.17 ms 1225.55 ms 9.38 ms
7b02433+dirty 1202.43 ms 1210.90 ms 8.47 ms
8d89cc9+dirty 1232.35 ms 1228.53 ms -3.82 ms
f17e051+dirty 1217.85 ms 1219.96 ms 2.11 ms
cd5f27f+dirty 1207.66 ms 1213.48 ms 5.82 ms
e2fa43d+dirty 1224.43 ms 1235.40 ms 10.98 ms

App size

Revision Plain With Sentry Diff
ec14be7+dirty 3.19 MiB 4.54 MiB 1.36 MiB
b3b5b0d+dirty 3.19 MiB 4.48 MiB 1.29 MiB
af9331b+dirty 3.19 MiB 4.48 MiB 1.29 MiB
8a868fe+dirty 3.38 MiB 4.60 MiB 1.22 MiB
90afdd3+dirty 3.19 MiB 4.55 MiB 1.37 MiB
7b02433+dirty 3.38 MiB 4.60 MiB 1.22 MiB
8d89cc9+dirty 3.19 MiB 4.53 MiB 1.35 MiB
f17e051+dirty 3.41 MiB 4.67 MiB 1.25 MiB
cd5f27f+dirty 3.38 MiB 4.78 MiB 1.39 MiB
e2fa43d+dirty 3.19 MiB 4.38 MiB 1.19 MiB

@github-actions
Copy link
Copy Markdown
Contributor

Android (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 418.79 ms 463.14 ms 44.35 ms
Size 43.94 MiB 49.33 MiB 5.39 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
8d89cc9+dirty 357.69 ms 415.79 ms 58.10 ms
90afdd3+dirty 367.79 ms 404.84 ms 37.05 ms
ff5a06a+dirty 438.29 ms 476.00 ms 37.71 ms
8ff81c0+dirty 392.47 ms 431.52 ms 39.05 ms
8d0a325+dirty 430.13 ms 476.52 ms 46.39 ms
170d5ea+dirty 348.79 ms 406.94 ms 58.15 ms
6c36ba5+dirty 367.14 ms 426.80 ms 59.66 ms
817b2c1+dirty 379.06 ms 404.96 ms 25.90 ms
90edad7+dirty 372.57 ms 398.83 ms 26.26 ms
136effd+dirty 451.30 ms 450.87 ms -0.43 ms

App size

Revision Plain With Sentry Diff
8d89cc9+dirty 7.15 MiB 8.41 MiB 1.26 MiB
90afdd3+dirty 7.15 MiB 8.43 MiB 1.28 MiB
ff5a06a+dirty 43.94 MiB 48.87 MiB 4.93 MiB
8ff81c0+dirty 43.94 MiB 48.87 MiB 4.93 MiB
8d0a325+dirty 43.94 MiB 48.91 MiB 4.97 MiB
170d5ea+dirty 7.15 MiB 8.42 MiB 1.27 MiB
6c36ba5+dirty 43.94 MiB 49.27 MiB 5.33 MiB
817b2c1+dirty 43.94 MiB 49.22 MiB 5.29 MiB
90edad7+dirty 7.15 MiB 8.43 MiB 1.28 MiB
136effd+dirty 43.94 MiB 48.81 MiB 4.88 MiB

Copy link
Copy Markdown
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.

Nice fix!

@antonis antonis merged commit 3f67e92 into main Feb 24, 2026
128 of 133 checks passed
@antonis antonis deleted the antonis/issue-5685 branch February 24, 2026 10:55
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.

Build fails when there is a JS syntax/import issue

2 participants