Skip to content

Commit 3332576

Browse files
committed
fix: process.turbopack is not supported in edge runtime
1 parent 3f45ae8 commit 3332576

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

packages/nextjs/src/client/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,7 @@ export function init(options: BrowserOptions): Client | undefined {
7777
}
7878

7979
try {
80-
// @ts-expect-error `process.turbopack` is a magic string that will be replaced by Next.js
81-
if (process.turbopack) {
80+
if (process.env.TURBOPACK === '1') {
8281
getGlobalScope().setTag('turbopack', true);
8382
}
8483
} catch {

packages/nextjs/src/edge/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,7 @@ export function init(options: VercelEdgeOptions = {}): void {
9595
});
9696

9797
try {
98-
// @ts-expect-error `process.turbopack` is a magic string that will be replaced by Next.js
99-
if (process.turbopack) {
98+
if (process.env.TURBOPACK === '1') {
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
@@ -368,8 +368,7 @@ export function init(options: NodeOptions): NodeClient | undefined {
368368
}
369369

370370
try {
371-
// @ts-expect-error `process.turbopack` is a magic string that will be replaced by Next.js
372-
if (process.turbopack) {
371+
if (process.env.TURBOPACK === '1') {
373372
getGlobalScope().setTag('turbopack', true);
374373
}
375374
} catch {

0 commit comments

Comments
 (0)