Skip to content

Commit 3a13e0e

Browse files
committed
fix(nextjs): simplify Turbopack detection using process.env.TURBOPACK
1 parent faffeb4 commit 3a13e0e

File tree

4 files changed

+3
-14
lines changed

4 files changed

+3
-14
lines changed

packages/nextjs/src/client/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { getDefaultIntegrations as getReactDefaultIntegrations, init as reactIni
55
import { devErrorSymbolicationEventProcessor } from '../common/devErrorSymbolicationEventProcessor';
66
import { getVercelEnv } from '../common/getVercelEnv';
77
import { isRedirectNavigationError } from '../common/nextNavigationErrorUtils';
8-
import { isTurbopack } from '../common/utils/isTurbopack';
98
import { browserTracingIntegration } from './browserTracingIntegration';
109
import { nextjsClientStackFrameNormalizationIntegration } from './clientNormalizationIntegration';
1110
import { INCOMPLETE_APP_ROUTER_INSTRUMENTATION_TRANSACTION_NAME } from './routing/appRouterRoutingInstrumentation';
@@ -78,7 +77,7 @@ export function init(options: BrowserOptions): Client | undefined {
7877
}
7978

8079
try {
81-
if (isTurbopack()) {
80+
if (process.env.TURBOPACK) {
8281
getGlobalScope().setTag('turbopack', true);
8382
}
8483
} catch {

packages/nextjs/src/common/utils/isTurbopack.ts

Lines changed: 0 additions & 8 deletions
This file was deleted.

packages/nextjs/src/edge/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import {
1414
import type { VercelEdgeOptions } from '@sentry/vercel-edge';
1515
import { getDefaultIntegrations, init as vercelEdgeInit } from '@sentry/vercel-edge';
1616
import { isBuild } from '../common/utils/isBuild';
17-
import { isTurbopack } from '../common/utils/isTurbopack';
1817
import { flushSafelyWithTimeout } from '../common/utils/responseEnd';
1918
import { distDirRewriteFramesIntegration } from './distDirRewriteFramesIntegration';
2019

@@ -96,7 +95,7 @@ export function init(options: VercelEdgeOptions = {}): void {
9695
});
9796

9897
try {
99-
if (isTurbopack()) {
98+
if (process.env.TURBOPACK) {
10099
getGlobalScope().setTag('turbopack', true);
101100
}
102101
} catch {

packages/nextjs/src/server/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ import {
3737
TRANSACTION_ATTR_SHOULD_DROP_TRANSACTION,
3838
} from '../common/span-attributes-with-logic-attached';
3939
import { isBuild } from '../common/utils/isBuild';
40-
import { isTurbopack } from '../common/utils/isTurbopack';
4140
import { distDirRewriteFramesIntegration } from './distDirRewriteFramesIntegration';
4241

4342
export * from '@sentry/node';
@@ -369,7 +368,7 @@ export function init(options: NodeOptions): NodeClient | undefined {
369368
}
370369

371370
try {
372-
if (isTurbopack()) {
371+
if (process.env.TURBOPACK) {
373372
getGlobalScope().setTag('turbopack', true);
374373
}
375374
} catch {

0 commit comments

Comments
 (0)