You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 2f5889c
Browse filesBrowse the repository at this point in the historyBrowse files
fix(tanstackstart-react): Delete only the source maps that Sentry enabled
The default `filesToDeleteAfterUpload: ['./**/*.map']` does not enter dot directories like
`.output`, so source maps that Sentry enabled stayed in the client build of Nitro apps.
Delete the source maps in the output directory of each environment that only has source maps
because Sentry enabled them. Keep source maps that the user enabled with `build.sourcemap`, an
environment setting or `build.rolldownOptions.output.sourcemap`. Warn on Vite 7, where Sentry
only knows `build.outDir`.
'[Sentry] Automatically setting `sourcemaps.filesToDeleteAfterUpload: ["./**/*.map"]` to delete generated source maps after they were uploaded to Sentry.',
`[Sentry] TanStack Start requires Vite 8 or later. With an older Vite, Sentry deletes the source maps it generated only in \`build.outDir\` of each environment, so source maps in other output directories can stay in the build output.`,
`[Sentry] Automatically setting \`sourcemaps.filesToDeleteAfterUpload: ${JSON.stringify(filesToDelete)}\` to delete generated source maps after they were uploaded to Sentry.`,
89
+
);
79
90
}
91
+
resolveFilesToDeleteAfterUpload?.(filesToDelete);
80
92
},
81
93
};
82
94
@@ -116,21 +128,72 @@ export function makeAddSentryVitePlugin(options: SentryTanstackStartOptions): Pl
116
128
return[configPlugin, ...sentryPlugins];
117
129
}
118
130
131
+
/**
132
+
* Globs for the source maps in the output directories that only have source maps because Sentry enabled them. A glob
133
+
* such as `./**\/*.map` does not enter dot directories like `.output`, where Nitro puts the client build.
'[Sentry] We discovered `vite.build.rolldownOptions.output.sourcemap`, which overrides `vite.build.sourcemap`. Sentry will keep this source map setting.',
254
+
);
255
+
}
256
+
257
+
returnundefined;
186
258
}
187
259
188
260
// If the user did not specify a source map setting, we enable 'hidden' by default
0 commit comments