File tree Expand file tree Collapse file tree 4 files changed +11
-4
lines changed
Expand file tree Collapse file tree 4 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ export function init(options: BrowserOptions): Client | undefined {
7878 }
7979
8080 try {
81- if ( isTurbopack ) {
81+ if ( isTurbopack ( ) ) {
8282 getGlobalScope ( ) . setTag ( 'turbopack' , true ) ;
8383 }
8484 } catch {
Original file line number Diff line number Diff line change 1- export const isTurbopack = process . env . TURBOPACK === '1' || ( typeof process !== 'undefined' && 'turbopack' in process && process . turbopack ) ;
1+ /**
2+ * Detect whether running under Turbopack
3+ */
4+ export function isTurbopack ( ) : boolean {
5+ if ( typeof process === 'undefined' ) return false ;
6+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
7+ return process . env ?. TURBOPACK === '1' || ! ! ( process as any ) ?. turbopack ;
8+ }
Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ export function init(options: VercelEdgeOptions = {}): void {
9696 } ) ;
9797
9898 try {
99- if ( isTurbopack ) {
99+ if ( isTurbopack ( ) ) {
100100 getGlobalScope ( ) . setTag ( 'turbopack' , true ) ;
101101 }
102102 } catch {
Original file line number Diff line number Diff line change @@ -369,7 +369,7 @@ export function init(options: NodeOptions): NodeClient | undefined {
369369 }
370370
371371 try {
372- if ( isTurbopack ) {
372+ if ( isTurbopack ( ) ) {
373373 getGlobalScope ( ) . setTag ( 'turbopack' , true ) ;
374374 }
375375 } catch {
You can’t perform that action at this time.
0 commit comments