Skip to content

Latest commit

 

History

History
52 lines (38 loc) · 1.84 KB

File metadata and controls

52 lines (38 loc) · 1.84 KB
title sentryTanstackStart
description Learn about the sentryTanstackStart Vite plugin.

The sentryTanstackStart Vite plugin simplifies source map configuration for TanStack Start applications. It automatically handles source map generation and upload to Sentry during production builds.

Usage

To automatically upload source maps, you need to provide your Sentry auth token, organization, and project slugs in your Vite configuration. The plugin then, by default, automatically enables hidden source maps and deletes .map files after upload.

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,
    }),
  ],
});
Source map upload **only** works when `org`, `project`, and `authToken` are all configured. Without these options, source maps will not be uploaded to Sentry.

Configuration Options

The plugin passes through all options to the underlying @sentry/vite-plugin. See the Sentry Vite Plugin documentation for the full list of available options.