@@ -53,17 +53,24 @@ export function getBuildPluginOptions({
5353 sourcemapUploadAssets . push ( path . posix . join ( normalizedDistDirAbsPath , 'static' , 'chunks' , '**' ) ) ;
5454 } else {
5555 // Webpack client builds
56- sourcemapUploadAssets . push (
57- path . posix . join ( normalizedDistDirAbsPath , 'static' , 'chunks' , 'pages' , '**' ) ,
58- path . posix . join ( normalizedDistDirAbsPath , 'static' , 'chunks' , 'app' , '**' ) ,
59- ) ;
56+ if ( sentryBuildOptions . widenClientFileUpload ) {
57+ sourcemapUploadAssets . push ( path . posix . join ( normalizedDistDirAbsPath , 'static' , 'chunks' , '**' ) ) ;
58+ } else {
59+ sourcemapUploadAssets . push (
60+ path . posix . join ( normalizedDistDirAbsPath , 'static' , 'chunks' , 'pages' , '**' ) ,
61+ path . posix . join ( normalizedDistDirAbsPath , 'static' , 'chunks' , 'app' , '**' ) ,
62+ ) ;
63+ }
6064 }
6165
6266 if ( sentryBuildOptions . sourcemaps ?. deleteSourcemapsAfterUpload ) {
6367 filesToDeleteAfterUpload . push (
64- path . posix . join ( normalizedDistDirAbsPath , '**' , '*.js.map' ) ,
65- path . posix . join ( normalizedDistDirAbsPath , '**' , '*.mjs.map' ) ,
66- path . posix . join ( normalizedDistDirAbsPath , '**' , '*.cjs.map' ) ,
68+ // We only care to delete client bundle source maps because they would be the ones being served.
69+ // Removing the server source maps crashes Vercel builds for (thus far) unknown reasons:
70+ // https://github.com/getsentry/sentry-javascript/issues/13099
71+ path . posix . join ( normalizedDistDirAbsPath , 'static' , '**' , '*.js.map' ) ,
72+ path . posix . join ( normalizedDistDirAbsPath , 'static' , '**' , '*.mjs.map' ) ,
73+ path . posix . join ( normalizedDistDirAbsPath , 'static' , '**' , '*.cjs.map' ) ,
6774 ) ;
6875 }
6976 } else {
0 commit comments