File tree 4 files changed +11
-7
lines changed
4 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ mount(() => <StartClient />, document.getElementById('app'));
60
60
61
61
### 3. Server-side Setup
62
62
63
- Create an instrument file named ` instrument.server.mjs ` and add your initialization code for the server-side SDK.
63
+ Create an instrument file named ` src/ instrument.server.ts ` and add your initialization code for the server-side SDK.
64
64
65
65
``` javascript
66
66
import * as Sentry from ' @sentry/solidstart' ;
@@ -125,6 +125,8 @@ export default defineConfig(withSentry({
125
125
Sentry relies on running ` instrument.server.ts ` as early as possible. Add the ` sentrySolidStartVite ` plugin
126
126
from ` @sentry/solidstart ` to your ` app.config.ts ` . This takes care of building ` instrument.server.ts ` and placing it alongside the server entry file.
127
127
128
+ If your ` instrument.server.ts ` file is not located in the ` src ` folder, you can specify the path via the ` sentrySolidStartVite ` plugin.
129
+
128
130
To upload source maps, configure an auth token. Auth tokens can be passed to the plugin explicitly with the ` authToken ` option, with a
129
131
` SENTRY_AUTH_TOKEN ` environment variable, or with an ` .env.sentry-build-plugin ` file in the working directory when
130
132
building your project. We recommend you add the auth token to your CI/CD environment as an environment variable.
@@ -147,6 +149,8 @@ export default defineConfig(withSentry({
147
149
project: process .env .SENTRY_PROJECT ,
148
150
authToken: process .env .SENTRY_AUTH_TOKEN ,
149
151
debug: true ,
152
+ // optional: if your `instrument.server.ts` file is not located inside `src`
153
+ instrumentation: ' ./mypath/instrument.server.ts'
150
154
}),
151
155
],
152
156
},
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ export type Nitro = {
13
13
14
14
export type SolidStartInlineConfig = Parameters < typeof defineConfig > [ 0 ] ;
15
15
16
- export type SolidStartInlineConfigNitroHooks = {
16
+ export type SolidStartInlineServerConfig = {
17
17
hooks ?: {
18
18
close ?: ( ) => unknown ;
19
19
'rollup:before' ?: ( nitro : Nitro ) => unknown ;
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import type {
6
6
Nitro ,
7
7
SentrySolidStartConfigOptions ,
8
8
SolidStartInlineConfig ,
9
- SolidStartInlineConfigNitroHooks ,
9
+ SolidStartInlineServerConfig ,
10
10
} from './types' ;
11
11
12
12
/**
@@ -22,7 +22,7 @@ export const withSentry = (
22
22
solidStartConfig : SolidStartInlineConfig = { } ,
23
23
sentrySolidStartConfigOptions : SentrySolidStartConfigOptions = { } ,
24
24
) : SolidStartInlineConfig => {
25
- const server = ( solidStartConfig . server || { } ) as SolidStartInlineConfigNitroHooks ;
25
+ const server = ( solidStartConfig . server || { } ) as SolidStartInlineServerConfig ;
26
26
const hooks = server . hooks || { } ;
27
27
28
28
let serverDir : string ;
Original file line number Diff line number Diff line change @@ -127,10 +127,10 @@ export type SentrySolidStartPluginOptions = {
127
127
debug ?: boolean ;
128
128
129
129
/**
130
- * The path to your `instrumentation .server.ts|js` file.
131
- * e.g. ' ./src/instrumentation .server.ts`
130
+ * The path to your `instrument .server.ts|js` file.
131
+ * e.g. ` ./src/instrument .server.ts`
132
132
*
133
- * Defaults to: `./src/instrumentation .server.ts`
133
+ * Defaults to: `./src/instrument .server.ts`
134
134
*/
135
135
instrumentation ?: string ;
136
136
} ;
You can’t perform that action at this time.
0 commit comments