Make sure you add your auth token to your CI, if you are using one to deploy your application.
Add your auth token to your environment:
SENTRY_AUTH_TOKEN=___ORG_AUTH_TOKEN___and configure sentryTanstackStart in your vite.config.ts:
import { defineConfig } from "vite";
import { sentryTanstackStart } from "@sentry/tanstackstart-react/vite";
import { tanstackStart } from "@tanstack/react-start/plugin/vite";
export default defineConfig({
plugins: [
tanstackStart(),
// other plugins - sentryTanstackStart should be last
sentryTanstackStart({
org: "___ORG_SLUG___",
project: "___PROJECT_SLUG___",
authToken: process.env.SENTRY_AUTH_TOKEN,
}),
],
});The plugin, by default, automatically enables hidden source maps and deletes .map files after upload.
Configure source map behavior using the plugin options, for example:
import { defineConfig } from "vite";
import { sentryTanstackStart } from "@sentry/tanstackstart-react/vite";
import { tanstackStart } from "@tanstack/react-start/plugin/vite";
export default defineConfig({
plugins: [
tanstackStart(),
sentryTanstackStart({
org: "___ORG_SLUG___",
project: "___PROJECT_SLUG___",
authToken: process.env.SENTRY_AUTH_TOKEN,
sourcemaps: {
assets: ["./dist/**/*"],
ignore: ["**/node_modules/**"],
filesToDeleteAfterUpload: [
"./**/*.map",
".*/**/public/**/*.map",
"./dist/**/client/**/*.map",
],
},
}),
],
});If you're experiencing issues with source maps, see Troubleshooting Source Maps.