Skip to content

Commit 39abfff

Browse files
committed
Revert "change nextjs version in e2e test"
This reverts commit 37649af.
1 parent 37649af commit 39abfff

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
@@ -21,7 +21,10 @@ import { flushQueue } from './utils/responseEnd';
2121

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

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

34-
return cb(rootSpan);
37+
return handleResponseErrors(rootSpan);
3538
} else {
3639
return startSpan(
3740
{
@@ -44,7 +47,7 @@ function startOrUpdateSpan(spanName: string, cb: (rootSpan: Span) => Promise<Res
4447
},
4548
},
4649
(span: Span) => {
47-
return cb(span);
50+
return handleResponseErrors(span);
4851
},
4952
);
5053
}

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)