Skip to content

Commit 71c1b3f

Browse files
committed
fix(react-router): Ensure source map upload fails if Sentry CLI fails
1 parent e2579bb commit 71c1b3f

File tree

2 files changed

+69
-4
lines changed

2 files changed

+69
-4
lines changed

packages/react-router/src/vite/buildEnd/handleOnBuildEnd.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,12 @@ export const sentryOnBuildEnd: BuildEndHook = async ({ reactRouterConfig, viteCo
5959
if (sourceMapsUploadOptions?.enabled ?? (true && viteConfig.build.sourcemap !== false)) {
6060
// inject debugIds
6161
try {
62-
await cliInstance.execute(['sourcemaps', 'inject', reactRouterConfig.buildDirectory], debug);
62+
await cliInstance.execute(
63+
['sourcemaps', 'inject', reactRouterConfig.buildDirectory],
64+
// @ts-expect-error - 'rejectOnError' is not yet exported as a type from @sentry/cli. It is valid though.
65+
// TODO: update to @sentry/[email protected] once the fix is released: https://github.com/getsentry/sentry-cli/pull/2628
66+
debug ? 'rejectOnError' : false,
67+
);
6368
} catch (error) {
6469
// eslint-disable-next-line no-console
6570
console.error('[Sentry] Could not inject debug ids', error);
@@ -73,6 +78,7 @@ export const sentryOnBuildEnd: BuildEndHook = async ({ reactRouterConfig, viteCo
7378
paths: [reactRouterConfig.buildDirectory],
7479
},
7580
],
81+
live: 'rejectOnError',
7682
});
7783
} catch (error) {
7884
// eslint-disable-next-line no-console

yarn.lock

Lines changed: 62 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6924,7 +6924,7 @@
69246924
mitt "^3.0.0"
69256925

69266926
"@sentry-internal/test-utils@link:dev-packages/test-utils":
6927-
version "10.1.0"
6927+
version "10.2.0"
69286928
dependencies:
69296929
express "^4.21.1"
69306930

@@ -6966,47 +6966,107 @@
69666966
magic-string "0.30.8"
69676967
unplugin "1.0.1"
69686968

6969+
6970+
version "2.49.0"
6971+
resolved "https://registry.yarnpkg.com/@sentry/cli-darwin/-/cli-darwin-2.49.0.tgz#290657e5840b360cb8ca25c8a78f8c0f15c66b03"
6972+
integrity sha512-bgowyDeFuXbjkGq1ZKqcWhmzgfBe7oKIXYWJOOps4+32QfG+YsrdNnottHS01td3bzrJq0QnHj8H12fA81DqrA==
6973+
69696974
69706975
version "2.50.2"
69716976
resolved "https://registry.yarnpkg.com/@sentry/cli-darwin/-/cli-darwin-2.50.2.tgz#fcf924fcc02cfa54748ff07a380334e533635c74"
69726977
integrity sha512-0Pjpl0vQqKhwuZm19z6AlEF+ds3fJg1KWabv8WzGaSc/fwxMEwjFwOZj+IxWBJPV578cXXNvB39vYjjpCH8j7A==
69736978

6979+
6980+
version "2.49.0"
6981+
resolved "https://registry.yarnpkg.com/@sentry/cli-linux-arm64/-/cli-linux-arm64-2.49.0.tgz#a732004d7131f7e7b44f6a64abdccc36efb35d52"
6982+
integrity sha512-dqxsDUd76aDm03fUwUOs5BR7RHLpSb2EH/B1hlWm0mFvo9uY907XxW9wDFx/qDpCdmpC0aF+lF/lOBOrG9B5Fg==
6983+
69746984
69756985
version "2.50.2"
69766986
resolved "https://registry.yarnpkg.com/@sentry/cli-linux-arm64/-/cli-linux-arm64-2.50.2.tgz#ac9e6dba42095832bac8084abab4b86fdd2956f3"
69776987
integrity sha512-03Cj215M3IdoHAwevCxm5oOm9WICFpuLR05DQnODFCeIUsGvE1pZsc+Gm0Ky/ZArq2PlShBJTpbHvXbCUka+0w==
69786988

6989+
6990+
version "2.49.0"
6991+
resolved "https://registry.yarnpkg.com/@sentry/cli-linux-arm/-/cli-linux-arm-2.49.0.tgz#73719561510df3369e05e9a4898b4e43b8753e4c"
6992+
integrity sha512-RBDIjIGmNsFw+a6vAt6m3D7ROKsMEB9i3u+UuIRxk0/DyHTcfVWxnK/ScPXGILM6PxQ2XOBfOKad0mmiDHBzZA==
6993+
69796994
69806995
version "2.50.2"
69816996
resolved "https://registry.yarnpkg.com/@sentry/cli-linux-arm/-/cli-linux-arm-2.50.2.tgz#835acd53ca83f6be9fc0d3d85a3cd4c694051bce"
69826997
integrity sha512-jzFwg9AeeuFAFtoCcyaDEPG05TU02uOy1nAX09c1g7FtsyQlPcbhI94JQGmnPzdRjjDmORtwIUiVZQrVTkDM7w==
69836998

6999+
7000+
version "2.49.0"
7001+
resolved "https://registry.yarnpkg.com/@sentry/cli-linux-i686/-/cli-linux-i686-2.49.0.tgz#8d1bb1378251a3aa995cc4b56bd352fa12a84b66"
7002+
integrity sha512-gDAd5/vJbEhd4Waud0Cd8ZRqLEagDlOvWwNH3KB694EiHJUwzRSiTA1YUVMYGI8Z9UyEA1sKxARwm2Trv99BxA==
7003+
69847004
69857005
version "2.50.2"
69867006
resolved "https://registry.yarnpkg.com/@sentry/cli-linux-i686/-/cli-linux-i686-2.50.2.tgz#72f0e4bc1c515754aa11225efce711a24fb53524"
69877007
integrity sha512-J+POvB34uVyHbIYF++Bc/OCLw+gqKW0H/y/mY7rRZCiocgpk266M4NtsOBl6bEaurMx1D+BCIEjr4nc01I/rqA==
69887008

7009+
7010+
version "2.49.0"
7011+
resolved "https://registry.yarnpkg.com/@sentry/cli-linux-x64/-/cli-linux-x64-2.49.0.tgz#7bf58fb7005c89fdde4e1262d5ed35e23065aceb"
7012+
integrity sha512-mbohGvPNhHjUciYNXzkt9TYUebTmxeAp9v9JfLSb/Soz6fubKwEHhpRJuz1zASxVWIR4PuqkePchqN5zhcLC0A==
7013+
69897014
69907015
version "2.50.2"
69917016
resolved "https://registry.yarnpkg.com/@sentry/cli-linux-x64/-/cli-linux-x64-2.50.2.tgz#d06f8ffd65871b1373a0d2228ab254d9456a615c"
69927017
integrity sha512-81yQVRLj8rnuHoYcrM7QbOw8ubA3weiMdPtTxTim1s6WExmPgnPTKxLCr9xzxGJxFdYo3xIOhtf5JFpUX/3j4A==
69937018

7019+
7020+
version "2.49.0"
7021+
resolved "https://registry.yarnpkg.com/@sentry/cli-win32-arm64/-/cli-win32-arm64-2.49.0.tgz#2bf6dd911acbe3ddb02eec0afb4301bb8fb25b53"
7022+
integrity sha512-3zwvsp61EPpSuGpGdXY4JelVJmNEjoj4vn5m6EFoOtk7OUI5/VFqqR4wchjy9Hjm3Eh6MB5K+KTKXs4W2p18ng==
7023+
69947024
69957025
version "2.50.2"
69967026
resolved "https://registry.yarnpkg.com/@sentry/cli-win32-arm64/-/cli-win32-arm64-2.50.2.tgz#4bd7a140367c17f77d621903cfe0914232108657"
69977027
integrity sha512-QjentLGvpibgiZlmlV9ifZyxV73lnGH6pFZWU5wLeRiaYKxWtNrrHpVs+HiWlRhkwQ0mG1/S40PGNgJ20DJ3gA==
69987028

7029+
7030+
version "2.49.0"
7031+
resolved "https://registry.yarnpkg.com/@sentry/cli-win32-i686/-/cli-win32-i686-2.49.0.tgz#32e31472ae6c5f69e538a4061d651937fcb8f14a"
7032+
integrity sha512-2oWaNl6z0BaOCAjM1Jxequfgjod3XO6wothxow4kA8e9+43JLhgarSdpwJPgQjcVyxjygwQ3/jKPdUFh0qNOmg==
7033+
69997034
70007035
version "2.50.2"
70017036
resolved "https://registry.yarnpkg.com/@sentry/cli-win32-i686/-/cli-win32-i686-2.50.2.tgz#1eb997cf780c396446cdd8e63c6d4309894465e8"
70027037
integrity sha512-UkBIIzkQkQ1UkjQX8kHm/+e7IxnEhK6CdgSjFyNlxkwALjDWHJjMztevqAPz3kv4LdM6q1MxpQ/mOqXICNhEGg==
70037038

7039+
7040+
version "2.49.0"
7041+
resolved "https://registry.yarnpkg.com/@sentry/cli-win32-x64/-/cli-win32-x64-2.49.0.tgz#86aab38cb41f885914d7c99ceaab7b6ce52c72c6"
7042+
integrity sha512-dR4ulyrA6ZT7x7cg4Rwm0tcHf4TZz5QO6t1W1jX6uJ9n/U0bOSqSFZHNf/RryiUzQE1g8LBthOYyKGMkET6T8w==
7043+
70047044
70057045
version "2.50.2"
70067046
resolved "https://registry.yarnpkg.com/@sentry/cli-win32-x64/-/cli-win32-x64-2.50.2.tgz#1d0c106125b6dc87f3a598ac02519c699f17a6c0"
70077047
integrity sha512-tE27pu1sRRub1Jpmemykv3QHddBcyUk39Fsvv+n4NDpQyMgsyVPcboxBZyby44F0jkpI/q3bUH2tfCB1TYDNLg==
70087048

7009-
"@sentry/cli@^2.49.0", "@sentry/cli@^2.50.2":
7049+
"@sentry/cli@^2.49.0":
7050+
version "2.49.0"
7051+
resolved "https://registry.yarnpkg.com/@sentry/cli/-/cli-2.49.0.tgz#a8332ae38e9f92a0da3d939bdbce119e63450e99"
7052+
integrity sha512-99IKax3yjOaPlWJh3rAJC/R6hdmZZJ2B3ACVP8CpOYE+JzGGLyir1fvTzrdFKFLPLOq2lGC3RqWuKqU7PJUTZQ==
7053+
dependencies:
7054+
https-proxy-agent "^5.0.0"
7055+
node-fetch "^2.6.7"
7056+
progress "^2.0.3"
7057+
proxy-from-env "^1.1.0"
7058+
which "^2.0.2"
7059+
optionalDependencies:
7060+
"@sentry/cli-darwin" "2.49.0"
7061+
"@sentry/cli-linux-arm" "2.49.0"
7062+
"@sentry/cli-linux-arm64" "2.49.0"
7063+
"@sentry/cli-linux-i686" "2.49.0"
7064+
"@sentry/cli-linux-x64" "2.49.0"
7065+
"@sentry/cli-win32-arm64" "2.49.0"
7066+
"@sentry/cli-win32-i686" "2.49.0"
7067+
"@sentry/cli-win32-x64" "2.49.0"
7068+
7069+
"@sentry/cli@^2.50.2":
70107070
version "2.50.2"
70117071
resolved "https://registry.yarnpkg.com/@sentry/cli/-/cli-2.50.2.tgz#9fb90f2ae6648fc0104f0ca7f528d2e19ee0ecae"
70127072
integrity sha512-m1L9shxutF3WHSyNld6Y1vMPoXfEyQhoRh1V3SYSdl+4AB40U+zr2sRzFa2OPm7XP4zYNaWuuuHLkY/iHITs8Q==
@@ -28567,7 +28627,6 @@ [email protected], stylus@^0.59.0:
2856728627

2856828628
sucrase@^3.27.0, sucrase@^3.35.0, sucrase@getsentry/sucrase#es2020-polyfills:
2856928629
version "3.36.0"
28570-
uid fd682f6129e507c00bb4e6319cc5d6b767e36061
2857128630
resolved "https://codeload.github.com/getsentry/sucrase/tar.gz/fd682f6129e507c00bb4e6319cc5d6b767e36061"
2857228631
dependencies:
2857328632
"@jridgewell/gen-mapping" "^0.3.2"

0 commit comments

Comments
 (0)