diff --git a/platform-includes/getting-started-config/javascript.solidstart.mdx b/platform-includes/getting-started-config/javascript.solidstart.mdx index 0449b5476e0aa..44ea4be0dc10e 100644 --- a/platform-includes/getting-started-config/javascript.solidstart.mdx +++ b/platform-includes/getting-started-config/javascript.solidstart.mdx @@ -53,7 +53,7 @@ The Sentry SDK provides [middleware lifecycle](https://docs.solidjs.com/solid-st Complete the setup by adding `sentryBeforeResponseMiddleware` to your `src/middleware.ts` file. If you don't have a `src/middleware.ts` file yet, create one: ```typescript {filename:src/middleware.ts} -import { sentryBeforeResponseMiddleware } from '@sentry/solidstart/middleware'; +import { sentryBeforeResponseMiddleware } from '@sentry/solidstart'; import { createMiddleware } from '@solidjs/start/middleware'; export default createMiddleware({ diff --git a/platform-includes/getting-started-sourcemaps/javascript.solidstart.mdx b/platform-includes/getting-started-sourcemaps/javascript.solidstart.mdx index c9d582346b284..2bfcd9b3bf8ab 100644 --- a/platform-includes/getting-started-sourcemaps/javascript.solidstart.mdx +++ b/platform-includes/getting-started-sourcemaps/javascript.solidstart.mdx @@ -1,24 +1,14 @@ ## Add Readable Stack Traces to Errors -To generate and upload source maps of your Solid Start app use our Vite bundler plugin. +To upload source maps, use the `sentrySolidStartVite` plugin from `@sentry/solidstart` and configure an auth token. +Auth tokens can be passed to the plugin explicitly with the `authToken` option. You can use the +`SENTRY_AUTH_TOKEN` environment variable or have an `.env.sentry-build-plugin` file in the working directory when +building your project. -### Install +We recommend you add the auth token to your CI/CD environment as an environment variable. -```bash {tabTitle:npm} -npm install --save-dev @sentry/vite-plugin -``` - -```bash {tabTitle:yarn} -yarn add --dev @sentry/vite-plugin -``` - -```bash {tabTitle:pnpm} -pnpm add --save-dev @sentry/vite-plugin -``` - -### Config - -To get readable stack traces in your production builds, set the `SENTRY_AUTH_TOKEN` environment variable in your build environment. You can also add the environment variable to a `.env.sentry-build-plugin` file in the root of your project. +Learn more about configuring the plugin in our +[Sentry Vite Plugin documentation](https://www.npmjs.com/package/@sentry/vite-plugin). @@ -28,26 +18,26 @@ SENTRY_PROJECT="___PROJECT_SLUG___" SENTRY_AUTH_TOKEN="___ORG_AUTH_TOKEN___" ``` -Finally, add the plugin in `app.config.ts` and enable sourcemaps. +Add the plugin to your `app.config.ts`. + ```TypeScript {filename:app.config.ts} +// app.config.ts import { defineConfig } from '@solidjs/start/config'; -import { sentryVitePlugin } from '@sentry/vite-plugin'; +import { sentrySolidStartVite } from '@sentry/solidstart'; export default defineConfig({ - // rest of your config // ... + vite: { - build: { - sourcemap: true, - }, plugins: [ - sentryVitePlugin({ + sentrySolidStartVite({ org: process.env.SENTRY_ORG, project: process.env.SENTRY_PROJECT, authToken: process.env.SENTRY_AUTH_TOKEN, }), ], }, + // ... }); ```