@@ -209,7 +209,7 @@ Update `vite.config.ts` to include the `sentryReactRouter` plugin. Also add your
209
209
210
210
<OrgAuthTokenNote />
211
211
212
- ``` typescript {filename: vite.config.ts}
212
+ ``` typescript {filename: vite.config.ts} {diff}
213
213
import { reactRouter } from ' @react-router/dev/vite' ;
214
214
import { sentryReactRouter , type SentryReactRouterBuildOptions } from ' @sentry/react-router' ;
215
215
import { defineConfig } from ' vite' ;
@@ -225,15 +225,15 @@ const sentryConfig: SentryReactRouterBuildOptions = {
225
225
226
226
export default defineConfig (config => {
227
227
return {
228
- plugins: [reactRouter (), sentryReactRouter (sentryConfig , config )],
229
- sentryConfig ,
228
+ + plugins: [reactRouter (),sentryReactRouter (sentryConfig , config )],
229
+ + sentryConfig , // Also pass the config here!
230
230
};
231
231
});
232
232
```
233
233
234
234
Include the ` sentryOnBuildEnd ` hook in ` react-router.config.ts ` :
235
235
236
- ``` typescript {filename: react-router.config.ts} {9 }
236
+ ``` typescript {filename: react-router.config.ts} {diff }
237
237
import type { Config } from ' @react-router/dev/config' ;
238
238
import { sentryOnBuildEnd } from ' @sentry/react-router' ;
239
239
@@ -242,7 +242,7 @@ export default {
242
242
buildEnd : async ({ viteConfig , reactRouterConfig , buildManifest }) => {
243
243
// ...
244
244
// Call this at the end of the hook
245
- await sentryOnBuildEnd ({ viteConfig , reactRouterConfig , buildManifest });
245
+ + await sentryOnBuildEnd ({ viteConfig , reactRouterConfig , buildManifest });
246
246
},
247
247
} satisfies Config ;
248
248
```
0 commit comments