You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This SDK is currently in **ALPHA**. Alpha features are still in progress, may have bugs and might include breaking changes.
7
+
This SDK is compatible with TanStack Start 1.0 RC and is currently in **ALPHA**. Alpha features are still in progress, may have bugs and might include breaking changes.
8
8
Please reach out on [GitHub](https://github.com/getsentry/sentry-javascript/issues/new/choose) if you have any feedback or concerns.
#### Moving the Sentry server config file for production usage
161
155
162
-
### Instrument Server Requests
156
+
For production monitoring, the Sentry server config file needs to be moved to your build output. Since [TanStack Start is designed to work with any hosting provider](https://tanstack.com/start/latest/docs/framework/react/guide/hosting), the exact location will depend on where your build artifacts are deployed (for example, `"/dist"`, `".output/server"` or a platform-specific directory).
163
157
164
-
Wrap the default stream handler with `wrapStreamHandlerWithSentry` in `src/server.tsx` to instrument requests to your server:
158
+
For example, when using [nitro](https://nitro.build/), copy the instrumentation file to `".output/server"`.
Add the Sentry middleware handler to your global middlewares in `src/global-middleware.ts` to instrument your server function invocations:
184
-
185
-
<Alertlevel="info">
186
-
187
-
If you haven't created `src/global-middleware.ts` file, follow the [TanStack Start documentation for Global Middleware](https://tanstack.com/start/latest/docs/framework/react/middleware#global-middleware) to set it up.
188
-
189
-
</Alert>
190
-
191
-
```ts {filename:src/global-middleware.ts}
192
-
import {
193
-
createMiddleware,
194
-
registerGlobalMiddleware,
195
-
} from"@tanstack/react-start";
196
-
import*asSentryfrom"@sentry/tanstackstart-react";
197
-
198
-
registerGlobalMiddleware({
199
-
middleware: [
200
-
createMiddleware({ type: "function" }).server(
201
-
Sentry.sentryGlobalServerMiddlewareHandler()
202
-
),
203
-
],
204
-
});
205
-
```
171
+
## Step 3: Capture TanStack Start React Errors
206
172
207
-
### Capturing Errors in Error Boundaries and Components (Optional)
173
+
### Instrument Server Requests and Server Functions
208
174
209
175
<Alertlevel="info">
210
176
Automatic error monitoring is not yet supported on the server side of TanStack
211
177
Start. Use `captureException` to manually capture errors in your server-side
212
178
code.
213
179
</Alert>
214
180
181
+
### Capturing Errors in Error Boundaries and Components (Optional)
182
+
215
183
Sentry automatically captures unhandled client-side errors. Errors caught by your own error boundaries aren't captured unless you report them manually:
216
184
217
185
#### Custom Error Boundary
@@ -255,11 +223,11 @@ const route = createRoute({
255
223
})
256
224
```
257
225
258
-
## Step 4: Avoid Ad Blockers With Tunneling (Optional)
226
+
## Step 3: Avoid Ad Blockers With Tunneling (Optional)
0 commit comments