Skip to content

Commit eb71af3

Browse files
mydeas1gr1d
authored andcommitted
Revert "change nextjs version in e2e test"
This reverts commit fda5f32.
1 parent 18230e7 commit eb71af3

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"@types/node": "18.11.17",
2121
"@types/react": "18.0.26",
2222
"@types/react-dom": "18.0.9",
23-
"next": "14.0.0",
23+
"next": "14.0.2",
2424
"react": "18.2.0",
2525
"react-dom": "18.2.0",
2626
"typescript": "4.9.5",

packages/nextjs/src/common/wrapRouteHandlerWithSentry.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ import { withIsolationScopeOrReuseFromRootSpan } from './utils/withIsolationScop
2222

2323
/** As our own HTTP integration is disabled (src/server/index.ts) the rootSpan comes from Next.js.
2424
* In case there is not root span, we start a new span. */
25-
function startOrUpdateSpan(spanName: string, cb: (rootSpan: Span) => Promise<Response>): Promise<Response> {
25+
function startOrUpdateSpan(
26+
spanName: string,
27+
handleResponseErrors: (rootSpan: Span) => Promise<Response>,
28+
): Promise<Response> {
2629
const activeSpan = getActiveSpan();
2730
const rootSpan = activeSpan && getRootSpan(activeSpan);
2831

@@ -32,7 +35,7 @@ function startOrUpdateSpan(spanName: string, cb: (rootSpan: Span) => Promise<Res
3235
rootSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_OP, 'http.server');
3336
rootSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, 'auto.function.nextjs');
3437

35-
return cb(rootSpan);
38+
return handleResponseErrors(rootSpan);
3639
} else {
3740
return startSpan(
3841
{
@@ -45,7 +48,7 @@ function startOrUpdateSpan(spanName: string, cb: (rootSpan: Span) => Promise<Res
4548
},
4649
},
4750
(span: Span) => {
48-
return cb(span);
51+
return handleResponseErrors(span);
4952
},
5053
);
5154
}

packages/nextjs/src/server/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { onUncaughtExceptionIntegration } from './onUncaughtExceptionIntegration
1212

1313
export * from '@sentry/node';
1414
import type { EventProcessor } from '@sentry/types';
15+
import { requestIsolationScopeIntegration } from './requestIsolationScopeIntegration';
1516

1617
export { captureUnderscoreErrorException } from '../common/_error';
1718
export { onUncaughtExceptionIntegration } from './onUncaughtExceptionIntegration';
@@ -81,7 +82,7 @@ export function init(options: NodeOptions): void {
8182
integration.name !== 'Http',
8283
),
8384
onUncaughtExceptionIntegration(),
84-
// requestIsolationScopeIntegration(),
85+
requestIsolationScopeIntegration(),
8586
];
8687

8788
// This value is injected at build time, based on the output directory specified in the build config. Though a default

0 commit comments

Comments
 (0)