From cb8b2fe91d26174c3e4b092e6321b6828e243b3e Mon Sep 17 00:00:00 2001 From: Bam4d Date: Fri, 22 Dec 2023 16:55:58 +0000 Subject: [PATCH] small fix for node fetch detection --- .github/workflows/build_publish.yaml | 2 +- src/client.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_publish.yaml b/.github/workflows/build_publish.yaml index 8f840b3..6b83159 100644 --- a/.github/workflows/build_publish.yaml +++ b/.github/workflows/build_publish.yaml @@ -27,7 +27,7 @@ jobs: - name: set node version uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 20 # Install Build stuff - name: Install Dependencies diff --git a/src/client.js b/src/client.js index 7822bd0..c8239da 100644 --- a/src/client.js +++ b/src/client.js @@ -1,5 +1,5 @@ let isNode = false; -if (typeof globalThis.fetch === 'undefined') { +if (typeof window === 'undefined' || typeof globalThis.fetch !== 'undefined') { globalThis.fetch = (await import('node-fetch')).default; isNode = true; }