Skip to content

Commit 6d4af1c

Browse files
authored
fix(nextjs): Use passthrough createReduxEnhancer on server (#11005)
1 parent 1185f38 commit 6d4af1c

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

dev-packages/e2e-tests/test-applications/nextjs-14/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@
1313
"test:assert": "pnpm test:prod && pnpm test:dev"
1414
},
1515
"dependencies": {
16+
"@playwright/test": "^1.27.1",
1617
"@sentry/nextjs": "latest || *",
1718
"@types/node": "18.11.17",
1819
"@types/react": "18.0.26",
1920
"@types/react-dom": "18.0.9",
20-
"next": "14.0.4",
21+
"next": "14.1.3",
2122
"react": "18.2.0",
2223
"react-dom": "18.2.0",
23-
"typescript": "4.9.5",
24-
"wait-port": "1.0.4",
2524
"ts-node": "10.9.1",
26-
"@playwright/test": "^1.27.1"
25+
"typescript": "4.9.5",
26+
"wait-port": "1.0.4"
2727
},
2828
"devDependencies": {
2929
"@sentry/types": "latest || *",

packages/nextjs/src/index.types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export declare const defaultStackParser: StackParser;
3030
export declare function getSentryRelease(fallback?: string): string | undefined;
3131

3232
export declare const ErrorBoundary: typeof clientSdk.ErrorBoundary;
33+
export declare const createReduxEnhancer: typeof clientSdk.createReduxEnhancer;
3334
export declare const showReportDialog: typeof clientSdk.showReportDialog;
3435
export declare const withErrorBoundary: typeof clientSdk.withErrorBoundary;
3536

packages/nextjs/src/server/index.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import { distDirRewriteFramesIntegration } from './distDirRewriteFramesIntegrati
1616
import { Http } from './httpIntegration';
1717
import { OnUncaughtException } from './onUncaughtExceptionIntegration';
1818

19-
export { createReduxEnhancer } from '@sentry/react';
2019
export * from '@sentry/node-experimental';
2120
export { captureUnderscoreErrorException } from '../common/_error';
2221

@@ -47,6 +46,13 @@ export const ErrorBoundary = (props: React.PropsWithChildren<unknown>): React.Re
4746
return props.children as React.ReactNode;
4847
};
4948

49+
/**
50+
* A passthrough redux enhancer for the server that doesn't depend on anything from the `@sentry/react` package.
51+
*/
52+
export function createReduxEnhancer() {
53+
return (createStore: unknown) => createStore;
54+
}
55+
5056
/**
5157
* A passthrough error boundary wrapper for the server that doesn't depend on any react. Error boundaries don't catch
5258
* SSR errors so they should simply be a passthrough.

0 commit comments

Comments
 (0)