Skip to content

Commit 52dde47

Browse files
nicohrubecclaude
andcommitted
fix(tanstackstart-react): Add server-side replayIntegration no-op stub
Using `Sentry.replayIntegration()` in shared client/server code (like `router.tsx`) causes a build error because `@sentry/node` doesn't export it. Adds a no-op stub on the server side, same pattern as `tanstackRouterBrowserTracingIntegration`. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d75440c commit 52dde47

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

packages/tanstackstart-react/src/index.types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export declare const unleashIntegration: typeof clientSdk.unleashIntegration;
3939

4040
export declare const wrapMiddlewaresWithSentry: typeof serverSdk.wrapMiddlewaresWithSentry;
4141

42+
export declare const replayIntegration: typeof clientSdk.replayIntegration;
4243
export declare const tanstackRouterBrowserTracingIntegration: typeof clientSdk.tanstackRouterBrowserTracingIntegration;
4344
export declare const sentryGlobalRequestMiddleware: typeof serverSdk.sentryGlobalRequestMiddleware;
4445
export declare const sentryGlobalFunctionMiddleware: typeof serverSdk.sentryGlobalFunctionMiddleware;

packages/tanstackstart-react/src/server/index.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@ export { wrapMiddlewaresWithSentry } from './middleware';
1111
export { sentryGlobalRequestMiddleware, sentryGlobalFunctionMiddleware } from './globalMiddleware';
1212
export { createSentryTunnelRoute } from './tunnelRoute';
1313

14+
/**
15+
* A no-op stub of the replay integration for the server. Router setup code is shared between client and server,
16+
* so this stub is needed to prevent build errors during SSR bundling.
17+
*/
18+
export function replayIntegration(_options?: Record<string, unknown>): Integration {
19+
return {
20+
name: 'Replay',
21+
setup() {},
22+
};
23+
}
24+
1425
/**
1526
* A no-op stub of the browser tracing integration for the server. Router setup code is shared between client and server,
1627
* so this stub is needed to prevent build errors during SSR bundling.

0 commit comments

Comments
 (0)