From 757d588dedc66864d0fcec692e9a22677ce38f0f Mon Sep 17 00:00:00 2001 From: Ansonhkg Date: Wed, 24 Apr 2024 16:21:50 +0100 Subject: [PATCH] fix: unable to polyfill fetch when using cross-fetch, replaced with node-fetch as dev dependency for now --- local-tests/build.mjs | 2 +- package.json | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/local-tests/build.mjs b/local-tests/build.mjs index 0ea3586e8e..644b2bce10 100644 --- a/local-tests/build.mjs +++ b/local-tests/build.mjs @@ -34,7 +34,7 @@ export const build = async () => { export const postBuildPolyfill = () => { try { const file = fs.readFileSync(`./${TEST_DIR}/build/test.mjs`, 'utf8'); - const content = `import fetch from 'cross-fetch'; + const content = `import fetch from 'node-fetch'; try { if (!globalThis.fetch) { globalThis.fetch = fetch; diff --git a/package.json b/package.json index 91460ceed7..f396e9b806 100644 --- a/package.json +++ b/package.json @@ -172,9 +172,9 @@ "cypress-metamask": "^1.0.5-development", "cypress-metamask-v2": "^1.7.2", "esbuild": "0.19.12", - "esbuild-plugin-tsc": "^0.4.0", "esbuild-node-builtins": "^0.1.0", "esbuild-node-externals": "^1.13.0", + "esbuild-plugin-tsc": "^0.4.0", "eslint": "8.48.0", "eslint-config-next": "12.2.3", "eslint-config-prettier": "9.1.0", @@ -189,6 +189,7 @@ "lerna": "^5.4.3", "live-server": "^1.2.2", "lokijs": "^1.5.12", + "node-fetch": "^2.6.1", "node-localstorage": "^3.0.5", "nodemon": "^2.0.20", "nx": "17.3.0",