diff --git a/src/common/fetch.ts b/src/common/fetch.ts index 8f41553b04ad8..c0ca7e3baf02c 100644 --- a/src/common/fetch.ts +++ b/src/common/fetch.ts @@ -14,9 +14,7 @@ * limitations under the License. */ -import { isNode } from '../environment.js'; - /* Use the global version if we're in the browser, else load the node-fetch module. */ export const getFetch = async (): Promise => { - return isNode ? (await import('cross-fetch')).fetch : globalThis.fetch; + return globalThis.fetch || (await import('cross-fetch')).fetch; };