Skip to content

Commit 697f68b

Browse files
ref(solidstart): Overhaul solidstart options and sourcemap uploading (#11173)
* ref(solidstart): Overhaul solidstart options and sourcemap uploading * Update sourcemap section * Update options structure to reflect the latest changes * Update platform-includes/getting-started-sourcemaps/javascript.solidstart.mdx Co-authored-by: vivianyentran <[email protected]> --------- Co-authored-by: vivianyentran <[email protected]>
1 parent 7b95848 commit 697f68b

File tree

2 files changed

+15
-25
lines changed

2 files changed

+15
-25
lines changed

platform-includes/getting-started-config/javascript.solidstart.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ The Sentry SDK provides [middleware lifecycle](https://docs.solidjs.com/solid-st
5353
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:
5454

5555
```typescript {filename:src/middleware.ts}
56-
import { sentryBeforeResponseMiddleware } from '@sentry/solidstart/middleware';
56+
import { sentryBeforeResponseMiddleware } from '@sentry/solidstart';
5757
import { createMiddleware } from '@solidjs/start/middleware';
5858

5959
export default createMiddleware({
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,14 @@
11
## Add Readable Stack Traces to Errors
22

3-
To generate and upload source maps of your Solid Start app use our Vite bundler plugin.
3+
To upload source maps, use the `sentrySolidStartVite` plugin from `@sentry/solidstart` and configure an auth token.
4+
Auth tokens can be passed to the plugin explicitly with the `authToken` option. You can use the
5+
`SENTRY_AUTH_TOKEN` environment variable or have an `.env.sentry-build-plugin` file in the working directory when
6+
building your project.
47

5-
### Install
8+
We recommend you add the auth token to your CI/CD environment as an environment variable.
69

7-
```bash {tabTitle:npm}
8-
npm install --save-dev @sentry/vite-plugin
9-
```
10-
11-
```bash {tabTitle:yarn}
12-
yarn add --dev @sentry/vite-plugin
13-
```
14-
15-
```bash {tabTitle:pnpm}
16-
pnpm add --save-dev @sentry/vite-plugin
17-
```
18-
19-
### Config
20-
21-
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.
10+
Learn more about configuring the plugin in our
11+
[Sentry Vite Plugin documentation](https://www.npmjs.com/package/@sentry/vite-plugin).
2212

2313
<OrgAuthTokenNote />
2414

@@ -28,26 +18,26 @@ SENTRY_PROJECT="___PROJECT_SLUG___"
2818
SENTRY_AUTH_TOKEN="___ORG_AUTH_TOKEN___"
2919
```
3020

31-
Finally, add the plugin in `app.config.ts` and enable sourcemaps.
21+
Add the plugin to your `app.config.ts`.
22+
3223

3324
```TypeScript {filename:app.config.ts}
25+
// app.config.ts
3426
import { defineConfig } from '@solidjs/start/config';
35-
import { sentryVitePlugin } from '@sentry/vite-plugin';
27+
import { sentrySolidStartVite } from '@sentry/solidstart';
3628

3729
export default defineConfig({
38-
// rest of your config
3930
// ...
31+
4032
vite: {
41-
build: {
42-
sourcemap: true,
43-
},
4433
plugins: [
45-
sentryVitePlugin({
34+
sentrySolidStartVite({
4635
org: process.env.SENTRY_ORG,
4736
project: process.env.SENTRY_PROJECT,
4837
authToken: process.env.SENTRY_AUTH_TOKEN,
4938
}),
5039
],
5140
},
41+
// ...
5242
});
5343
```

0 commit comments

Comments
 (0)