Skip to content

Commit 4789457

Browse files
committed
Fix browser detection
Web Workers are browser too.
1 parent 6064f27 commit 4789457

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/util/src/environment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export function isNode(): boolean {
6868
* Detect Browser Environment
6969
*/
7070
export function isBrowser(): boolean {
71-
return typeof window !== 'undefined';
71+
return typeof self === 'object' && self.self === self;
7272
}
7373

7474
/**

0 commit comments

Comments
 (0)