Skip to content

Commit 607104c

Browse files
author
Luca Forstner
authored
fix(nextjs/v7): Use passthrough createReduxEnhancer on server (#11010)
Fixes #10366
1 parent 3588dc0 commit 607104c

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
@@ -38,6 +38,7 @@ export declare const rewriteFramesIntegration: typeof clientSdk.rewriteFramesInt
3838
export declare function getSentryRelease(fallback?: string): string | undefined;
3939

4040
export declare const ErrorBoundary: typeof clientSdk.ErrorBoundary;
41+
export declare const createReduxEnhancer: typeof clientSdk.createReduxEnhancer;
4142
export declare const showReportDialog: typeof clientSdk.showReportDialog;
4243
export declare const withErrorBoundary: typeof clientSdk.withErrorBoundary;
4344

packages/nextjs/src/server/index.ts

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

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

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

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

0 commit comments

Comments
 (0)