@@ -103,64 +103,39 @@ the client and server.
103
103
104
104
### 5. Configure your application
105
105
106
- For Sentry to work properly, SolidStart's ` app.config.ts ` has to be modified.
107
-
108
- #### 5.1 Wrapping the config with ` withSentry `
109
-
110
- Add ` withSentry ` from ` @sentry/solidstart ` and wrap SolidStart's config inside ` app.config.ts ` .
111
-
112
- ``` typescript
113
- import { defineConfig } from ' @solidjs/start/config' ;
114
- import { withSentry } from ' @sentry/solidstart' ;
115
-
116
- export default defineConfig (
117
- withSentry ({
118
- // ...
119
- middleware: ' ./src/middleware.ts' ,
120
- }),
121
- );
122
- ```
123
-
124
- #### 5.2 Generate source maps and build ` instrument.server.ts `
125
-
126
- Sentry relies on running ` instrument.server.ts ` as early as possible. Add the ` sentrySolidStartVite ` plugin from
127
- ` @sentry/solidstart ` to your ` app.config.ts ` . This takes care of building ` instrument.server.ts ` and placing it
128
- alongside the server entry file.
106
+ For Sentry to work properly, SolidStart's ` app.config.ts ` has to be modified. Wrap your config with ` withSentry ` and
107
+ configure it to upload source maps.
129
108
130
109
If your ` instrument.server.ts ` file is not located in the ` src ` folder, you can specify the path via the
131
- ` sentrySolidStartVite ` plugin .
110
+ ` instrumentation ` option to ` withSentry ` .
132
111
133
- To upload source maps, configure an auth token. Auth tokens can be passed to the plugin explicitly with the ` authToken `
134
- option, with a ` SENTRY_AUTH_TOKEN ` environment variable, or with an ` .env.sentry-build-plugin ` file in the working
135
- directory when building your project. We recommend you add the auth token to your CI/CD environment as an environment
136
- variable.
112
+ To upload source maps, configure an auth token. Auth tokens can be passed explicitly with the ` authToken ` option, with a
113
+ ` SENTRY_AUTH_TOKEN ` environment variable, or with an ` .env.sentry-build-plugin ` file in the working directory when
114
+ building your project. We recommend adding the auth token to your CI/CD environment as an environment variable.
137
115
138
116
Learn more about configuring the plugin in our
139
117
[ Sentry Vite Plugin documentation] ( https://www.npmjs.com/package/@sentry/vite-plugin ) .
140
118
141
119
``` typescript
142
- // app.config.ts
143
120
import { defineConfig } from ' @solidjs/start/config' ;
144
- import { sentrySolidStartVite , withSentry } from ' @sentry/solidstart' ;
121
+ import { withSentry } from ' @sentry/solidstart' ;
145
122
146
123
export default defineConfig (
147
- withSentry ({
148
- // ...
149
- middleware: ' ./src/middleware.ts' ,
150
- vite: {
151
- plugins: [
152
- sentrySolidStartVite ({
153
- org: process .env .SENTRY_ORG ,
154
- project: process .env .SENTRY_PROJECT ,
155
- authToken: process .env .SENTRY_AUTH_TOKEN ,
156
- debug: true ,
157
- // optional: if your `instrument.server.ts` file is not located inside `src`
158
- instrumentation: ' ./mypath/instrument.server.ts' ,
159
- }),
160
- ],
124
+ withSentry (
125
+ {
126
+ // SolidStart config
127
+ middleware: ' ./src/middleware.ts' ,
128
+ },
129
+ {
130
+ // Sentry `withSentry` options
131
+ org: process .env .SENTRY_ORG ,
132
+ project: process .env .SENTRY_PROJECT ,
133
+ authToken: process .env .SENTRY_AUTH_TOKEN ,
134
+ debug: true ,
135
+ // optional: if your `instrument.server.ts` file is not located inside `src`
136
+ instrumentation: ' ./mypath/instrument.server.ts' ,
161
137
},
162
- // ...
163
- }),
138
+ ),
164
139
);
165
140
```
166
141
@@ -188,28 +163,25 @@ For such platforms, we offer the `experimental_basicServerTracing` flag to add a
188
163
` instrument.server.mjs ` to the server entry file.
189
164
190
165
``` typescript
191
- // app.config.ts
192
166
import { defineConfig } from ' @solidjs/start/config' ;
193
- import { sentrySolidStartVite , withSentry } from ' @sentry/solidstart' ;
167
+ import { withSentry } from ' @sentry/solidstart' ;
194
168
195
169
export default defineConfig (
196
170
withSentry (
197
171
{
198
172
// ...
199
173
middleware: ' ./src/middleware.ts' ,
200
- vite: {
201
- plugins: [
202
- sentrySolidStartVite ({
203
- org: process .env .SENTRY_ORG ,
204
- project: process .env .SENTRY_PROJECT ,
205
- authToken: process .env .SENTRY_AUTH_TOKEN ,
206
- debug: true ,
207
- }),
208
- ],
209
- },
210
- // ...
211
174
},
212
- { experimental_basicServerTracing: true },
175
+ {
176
+ org: process .env .SENTRY_ORG ,
177
+ project: process .env .SENTRY_PROJECT ,
178
+ authToken: process .env .SENTRY_AUTH_TOKEN ,
179
+ debug: true ,
180
+ // optional: if your `instrument.server.ts` file is not located inside `src`
181
+ instrumentation: ' ./mypath/instrument.server.ts' ,
182
+ // optional: if NODE_OPTIONS or --import is not avaiable
183
+ experimental_basicServerTracing: true ,
184
+ },
213
185
),
214
186
);
215
187
```
0 commit comments