Source Maps

Upload your source maps to Sentry to enable readable stack traces in your errors.

@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.

Copied
npx @sentry/wizard@latest -i solidstart

The SolidStart SDK uses the Sentry Vite Plugin under the hood to upload source maps. See the Manual Configuration page and the Sentry Vite plugin documentation 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:

@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.

If you installed the SDK manually or the wizard failed, follow the steps below to manually 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
Copied
SENTRY_AUTH_TOKEN=sntrys_YOUR_TOKEN_HERE

Configure source map behavior using the source maps options in your SolidStart config:

app.config.ts
Copied
export default defineConfig(
  withSentry(
    {
      /* Your SolidStart config */
    },
    {
      sourceMapsUploadOptions: {
        org: "example-org",
        project: "example-project",
        authToken: process.env.SENTRY_AUTH_TOKEN,
        sourcemaps: {
          assets: ["./dist/**/*"],
          ignore: ["**/node_modules/**"],
          filesToDeleteAfterUpload: ["./dist/**/*.map"],
        },
      },
    },
  ),
);

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

app.config.ts
Copied
export default defineConfig(
  withSentry(
    {
      /* Your SolidStart config */
    },
    {
      sourceMapsUploadOptions: {
        enabled: false,
      },
    },
  ),
);

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.

If you're experiencing issues with source maps, see Troubleshooting Source Maps.

Was this helpful?
Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").