diff options
Diffstat (limited to 'packages/utils/src/fetchAsync.ts')
-rw-r--r-- | packages/utils/src/fetchAsync.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/packages/utils/src/fetchAsync.ts b/packages/utils/src/fetchAsync.ts index a009f0c86..47d87815e 100644 --- a/packages/utils/src/fetchAsync.ts +++ b/packages/utils/src/fetchAsync.ts @@ -1,3 +1,4 @@ +import isNode = require('detect-node'); import 'isomorphic-fetch'; export const fetchAsync = async ( @@ -6,7 +7,7 @@ export const fetchAsync = async ( timeoutMs: number = 20000, ): Promise<Response> => { let optionsWithAbortParam; - if ((process as any).browser === true) { + if (isNode) { const controller = new AbortController(); const signal = controller.signal; setTimeout(() => { |