Skip to content

Commit 5ed7804

Browse files
committed
fix(react-router): Ensure source map upload fails if Sentry CLI fails
1 parent 8cc324c commit 5ed7804

File tree

3 files changed

+68
-2
lines changed

3 files changed

+68
-2
lines changed

packages/react-router/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"@opentelemetry/instrumentation": "^0.203.0",
4040
"@opentelemetry/semantic-conventions": "^1.34.0",
4141
"@sentry/browser": "9.40.0",
42-
"@sentry/cli": "^2.46.0",
42+
"@sentry/cli": "^2.49.0",
4343
"@sentry/core": "9.40.0",
4444
"@sentry/node": "9.40.0",
4545
"@sentry/react": "9.40.0",

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: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6966,6 +6966,11 @@
69666966
resolved "https://registry.yarnpkg.com/@sentry/cli-darwin/-/cli-darwin-2.46.0.tgz#e07ff66f03e8cb6e1988b7673ae5dbd6ff957b1d"
69676967
integrity sha512-5Ll+e5KAdIk9OYiZO8aifMBRNWmNyPjSqdjaHlBC1Qfh7pE3b1zyzoHlsUazG0bv0sNrSGea8e7kF5wIO1hvyg==
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.42.2"
69716976
resolved "https://registry.yarnpkg.com/@sentry/cli-linux-arm64/-/cli-linux-arm64-2.42.2.tgz#1c06c83ff21f51ec23acf5be3b1f8c7553bf86b1"
@@ -6976,6 +6981,11 @@
69766981
resolved "https://registry.yarnpkg.com/@sentry/cli-linux-arm64/-/cli-linux-arm64-2.46.0.tgz#d5b27e5813e7b3add65c9e3dbdd75a8bea4ef324"
69776982
integrity sha512-OEJN8yAjI9y5B4telyqzu27Hi3+S4T8VxZCqJz1+z2Mp0Q/MZ622AahVPpcrVq/5bxrnlZR16+lKh8L1QwNFPg==
69786983

6984+
6985+
version "2.49.0"
6986+
resolved "https://registry.yarnpkg.com/@sentry/cli-linux-arm64/-/cli-linux-arm64-2.49.0.tgz#a732004d7131f7e7b44f6a64abdccc36efb35d52"
6987+
integrity sha512-dqxsDUd76aDm03fUwUOs5BR7RHLpSb2EH/B1hlWm0mFvo9uY907XxW9wDFx/qDpCdmpC0aF+lF/lOBOrG9B5Fg==
6988+
69796989
69806990
version "2.42.2"
69816991
resolved "https://registry.yarnpkg.com/@sentry/cli-linux-arm/-/cli-linux-arm-2.42.2.tgz#00cadc359ae3c051efb3e63873c033c61dbd1ca1"
@@ -6986,6 +6996,11 @@
69866996
resolved "https://registry.yarnpkg.com/@sentry/cli-linux-arm/-/cli-linux-arm-2.46.0.tgz#d2a0f21cd208ef8e844bc5e565b337640d125441"
69876997
integrity sha512-WRrLNq/TEX/TNJkGqq6Ad0tGyapd5dwlxtsPbVBrIdryuL1mA7VCBoaHBr3kcwJLsgBHFH0lmkMee2ubNZZdkg==
69886998

6999+
7000+
version "2.49.0"
7001+
resolved "https://registry.yarnpkg.com/@sentry/cli-linux-arm/-/cli-linux-arm-2.49.0.tgz#73719561510df3369e05e9a4898b4e43b8753e4c"
7002+
integrity sha512-RBDIjIGmNsFw+a6vAt6m3D7ROKsMEB9i3u+UuIRxk0/DyHTcfVWxnK/ScPXGILM6PxQ2XOBfOKad0mmiDHBzZA==
7003+
69897004
69907005
version "2.42.2"
69917006
resolved "https://registry.yarnpkg.com/@sentry/cli-linux-i686/-/cli-linux-i686-2.42.2.tgz#3b817b715dd806c20dfbffd539725ad8089c310a"
@@ -6996,6 +7011,11 @@
69967011
resolved "https://registry.yarnpkg.com/@sentry/cli-linux-i686/-/cli-linux-i686-2.46.0.tgz#73368ebe30236c8647caec420f717a7f45410f29"
69977012
integrity sha512-xko3/BVa4LX8EmRxVOCipV+PwfcK5Xs8lP6lgF+7NeuAHMNL4DqF6iV9rrN8gkGUHCUI9RXSve37uuZnFy55+Q==
69987013

7014+
7015+
version "2.49.0"
7016+
resolved "https://registry.yarnpkg.com/@sentry/cli-linux-i686/-/cli-linux-i686-2.49.0.tgz#8d1bb1378251a3aa995cc4b56bd352fa12a84b66"
7017+
integrity sha512-gDAd5/vJbEhd4Waud0Cd8ZRqLEagDlOvWwNH3KB694EiHJUwzRSiTA1YUVMYGI8Z9UyEA1sKxARwm2Trv99BxA==
7018+
69997019
70007020
version "2.42.2"
70017021
resolved "https://registry.yarnpkg.com/@sentry/cli-linux-x64/-/cli-linux-x64-2.42.2.tgz#ddf906bc3071cc79ce6e633eddcb76bb9068e688"
@@ -7006,11 +7026,21 @@
70067026
resolved "https://registry.yarnpkg.com/@sentry/cli-linux-x64/-/cli-linux-x64-2.46.0.tgz#49da3dfd873e0e72abef968e1c213b9397e5d70e"
70077027
integrity sha512-hJ1g5UEboYcOuRia96LxjJ0jhnmk8EWLDvlGnXLnYHkwy3ree/L7sNgdp/QsY8Z4j2PGO5f22Va+UDhSjhzlfQ==
70087028

7029+
7030+
version "2.49.0"
7031+
resolved "https://registry.yarnpkg.com/@sentry/cli-linux-x64/-/cli-linux-x64-2.49.0.tgz#7bf58fb7005c89fdde4e1262d5ed35e23065aceb"
7032+
integrity sha512-mbohGvPNhHjUciYNXzkt9TYUebTmxeAp9v9JfLSb/Soz6fubKwEHhpRJuz1zASxVWIR4PuqkePchqN5zhcLC0A==
7033+
70097034
70107035
version "2.46.0"
70117036
resolved "https://registry.yarnpkg.com/@sentry/cli-win32-arm64/-/cli-win32-arm64-2.46.0.tgz#4e26b254d5283eb114ac916ac504283a30b2ecdb"
70127037
integrity sha512-mN7cpPoCv2VExFRGHt+IoK11yx4pM4ADZQGEso5BAUZ5duViXB2WrAXCLd8DrwMnP0OE978a7N8OtzsFqjkbNA==
70137038

7039+
7040+
version "2.49.0"
7041+
resolved "https://registry.yarnpkg.com/@sentry/cli-win32-arm64/-/cli-win32-arm64-2.49.0.tgz#2bf6dd911acbe3ddb02eec0afb4301bb8fb25b53"
7042+
integrity sha512-3zwvsp61EPpSuGpGdXY4JelVJmNEjoj4vn5m6EFoOtk7OUI5/VFqqR4wchjy9Hjm3Eh6MB5K+KTKXs4W2p18ng==
7043+
70147044
70157045
version "2.42.2"
70167046
resolved "https://registry.yarnpkg.com/@sentry/cli-win32-i686/-/cli-win32-i686-2.42.2.tgz#9036085c7c6ce455ad45fda411c55ff39c06eb95"
@@ -7021,6 +7051,11 @@
70217051
resolved "https://registry.yarnpkg.com/@sentry/cli-win32-i686/-/cli-win32-i686-2.46.0.tgz#72f7c0a611f17b7e5b34e2b47309d165195a8276"
70227052
integrity sha512-6F73AUE3lm71BISUO19OmlnkFD5WVe4/wA1YivtLZTc1RU3eUYJLYxhDfaH3P77+ycDppQ2yCgemLRaA4A8mNQ==
70237053

7054+
7055+
version "2.49.0"
7056+
resolved "https://registry.yarnpkg.com/@sentry/cli-win32-i686/-/cli-win32-i686-2.49.0.tgz#32e31472ae6c5f69e538a4061d651937fcb8f14a"
7057+
integrity sha512-2oWaNl6z0BaOCAjM1Jxequfgjod3XO6wothxow4kA8e9+43JLhgarSdpwJPgQjcVyxjygwQ3/jKPdUFh0qNOmg==
7058+
70247059
70257060
version "2.42.2"
70267061
resolved "https://registry.yarnpkg.com/@sentry/cli-win32-x64/-/cli-win32-x64-2.42.2.tgz#7d6464b63f32c9f97fff428f246b1f039b402233"
@@ -7031,6 +7066,11 @@
70317066
resolved "https://registry.yarnpkg.com/@sentry/cli-win32-x64/-/cli-win32-x64-2.46.0.tgz#8cfd438ec365b0ee925d9724a24b533b4cb75587"
70327067
integrity sha512-yuGVcfepnNL84LGA0GjHzdMIcOzMe0bjPhq/rwPsPN+zu11N+nPR2wV2Bum4U0eQdqYH3iAlMdL5/BEQfuLJww==
70337068

7069+
7070+
version "2.49.0"
7071+
resolved "https://registry.yarnpkg.com/@sentry/cli-win32-x64/-/cli-win32-x64-2.49.0.tgz#86aab38cb41f885914d7c99ceaab7b6ce52c72c6"
7072+
integrity sha512-dR4ulyrA6ZT7x7cg4Rwm0tcHf4TZz5QO6t1W1jX6uJ9n/U0bOSqSFZHNf/RryiUzQE1g8LBthOYyKGMkET6T8w==
7073+
70347074
70357075
version "2.42.2"
70367076
resolved "https://registry.yarnpkg.com/@sentry/cli/-/cli-2.42.2.tgz#8173df4d057d600a9ef0cf1e9b42b0c6607b46e4"
@@ -7070,6 +7110,26 @@
70707110
"@sentry/cli-win32-i686" "2.46.0"
70717111
"@sentry/cli-win32-x64" "2.46.0"
70727112

7113+
"@sentry/cli@^2.49.0":
7114+
version "2.49.0"
7115+
resolved "https://registry.yarnpkg.com/@sentry/cli/-/cli-2.49.0.tgz#a8332ae38e9f92a0da3d939bdbce119e63450e99"
7116+
integrity sha512-99IKax3yjOaPlWJh3rAJC/R6hdmZZJ2B3ACVP8CpOYE+JzGGLyir1fvTzrdFKFLPLOq2lGC3RqWuKqU7PJUTZQ==
7117+
dependencies:
7118+
https-proxy-agent "^5.0.0"
7119+
node-fetch "^2.6.7"
7120+
progress "^2.0.3"
7121+
proxy-from-env "^1.1.0"
7122+
which "^2.0.2"
7123+
optionalDependencies:
7124+
"@sentry/cli-darwin" "2.49.0"
7125+
"@sentry/cli-linux-arm" "2.49.0"
7126+
"@sentry/cli-linux-arm64" "2.49.0"
7127+
"@sentry/cli-linux-i686" "2.49.0"
7128+
"@sentry/cli-linux-x64" "2.49.0"
7129+
"@sentry/cli-win32-arm64" "2.49.0"
7130+
"@sentry/cli-win32-i686" "2.49.0"
7131+
"@sentry/cli-win32-x64" "2.49.0"
7132+
70737133
"@sentry/rollup-plugin@^3.5.0":
70747134
version "3.5.0"
70757135
resolved "https://registry.yarnpkg.com/@sentry/rollup-plugin/-/rollup-plugin-3.5.0.tgz#9015c48e00257f8440597167498499804371329b"

0 commit comments

Comments
 (0)