---
title: "Source Maps"
description: "Upload your source maps to Sentry to enable readable stack traces in your errors."
url: https://docs.sentry.io/platforms/javascript/guides/solidstart/sourcemaps/
---

# Source Maps | Sentry for SolidStart

`@sentry/solidstart` will generate and upload source maps automatically during production builds, so that errors in Sentry contain readable stack traces.

The easiest way to configure uploading source maps is by using the [Sentry Wizard](https://docs.sentry.io/platforms/javascript/guides/solidstart.md#step-1-install).

```bash
npx @sentry/wizard@latest -i solidstart
```

The SolidStart SDK uses the Sentry Vite Plugin under the hood to upload source maps. See the [Vite plugin documentation](https://www.npmjs.com/package/@sentry/vite-plugin/#configuration) for more details.

**Note:** Source maps are only generated and uploaded during **production builds** (`npm run build`). Development builds (`npm run dev`) do not generate source maps for upload.

See how uploading source maps lets you see the exact line of code that caused an error:

## [Uploading Source Maps in a SolidStart Project](https://docs.sentry.io/platforms/javascript/guides/solidstart/sourcemaps.md#uploading-source-maps-in-a-solidstart-project)

`@sentry/solidstart` will generate and upload source maps automatically during production builds, so that errors in Sentry contain readable stack traces.

### [Automatic Setup](https://docs.sentry.io/platforms/javascript/guides/solidstart/sourcemaps.md#automatic-setup)

The easiest way to configure uploading source maps is by using the [Sentry Wizard](https://docs.sentry.io/platforms/javascript/guides/solidstart.md#step-1-install).

### [Manual Configuration](https://docs.sentry.io/platforms/javascript/guides/solidstart/sourcemaps.md#manual-configuration)

If you installed the SDK manually or the wizard failed, follow the steps below to manually configure source maps upload.

#### [1. Configure Source Maps Upload](https://docs.sentry.io/platforms/javascript/guides/solidstart/sourcemaps.md#1-configure-source-maps-upload)

To automatically upload source maps, you need to provide your Sentry auth token, organization, and project slugs in your SolidStart configuration:

**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:

`.env`

```bash
SENTRY_AUTH_TOKEN=___ORG_AUTH_TOKEN___
```

Using environment variables in Vite configs

Vite doesn't automatically load `.env` files into `process.env` when evaluating the config file. If you store your auth token in a `.env` file and want to access it via `process.env.SENTRY_AUTH_TOKEN`, use Vite's [`loadEnv`](https://vite.dev/guide/api-javascript#loadenv) helper:

`vite.config.js`

```javascript
import { defineConfig, loadEnv } from "vite";

export default defineConfig(({ mode }) => {
  const env = loadEnv(mode, process.cwd(), "");

  return {
    plugins: [
      sentryVitePlugin({
        authToken: env.SENTRY_AUTH_TOKEN,
        // ...
      }),
    ],
  };
});
```

Alternatively, use a `.env.sentry-build-plugin` file, which the Sentry plugin reads automatically.

`app.config.ts`

```javascript
export default defineConfig(
  withSentry(
    {
      /* Your SolidStart config */
    },
    {
      org: "___ORG_SLUG___",
      project: "___PROJECT_SLUG___",
      authToken: process.env.SENTRY_AUTH_TOKEN,
    },
  ),
);
```

#### [2. Source Map Options](https://docs.sentry.io/platforms/javascript/guides/solidstart/sourcemaps.md#2-source-map-options)

Configure source map behavior in your SolidStart config:

`app.config.ts`

```javascript
export default defineConfig(
  withSentry(
    {
      /* Your SolidStart config */
    },
    {
      org: "___ORG_SLUG___",
      project: "___PROJECT_SLUG___",
      authToken: process.env.SENTRY_AUTH_TOKEN,
      sourcemaps: {
        assets: ["./dist/**/*"],
        ignore: ["**/node_modules/**"],
        filesToDeleteAfterUpload: ["./**/*.map", "./dist/**/*.map"],
      },
    },
  ),
);
```

### [Disable Source Maps Upload](https://docs.sentry.io/platforms/javascript/guides/solidstart/sourcemaps.md#disable-source-maps-upload)

You can disable automatic source maps upload in your SolidStart configuration:

`app.config.ts`

```javascript
export default defineConfig(
  withSentry(
    {
      /* Your SolidStart config */
    },
    {
      disable: true,
    },
  ),
);
```

**Note:** Source maps are only generated and uploaded during **production builds** (`npm run build`). Development builds (`npm run dev`) do not generate source maps for upload.

### [Troubleshooting](https://docs.sentry.io/platforms/javascript/guides/solidstart/sourcemaps.md#troubleshooting)

If you're experiencing issues with source maps, see [Troubleshooting Source Maps](https://docs.sentry.io/platforms/javascript/guides/solidstart/troubleshooting.md).

## [Additional Resources](https://docs.sentry.io/platforms/javascript/guides/solidstart/sourcemaps.md#additional-resources)

* [Using sentry-cli to Upload Source Maps](https://docs.sentry.io/cli/releases.md#sentry-cli-sourcemaps)
* [4 Reasons Why Your Source Maps Are Broken](https://blog.sentry.io/2018/10/18/4-reasons-why-your-source-maps-are-broken)

## Pages in this section

- [Troubleshooting Source Maps](https://docs.sentry.io/platforms/javascript/guides/solidstart/sourcemaps/troubleshooting_js.md)
