Skip to content

Commit

Permalink
fix: unable to polyfill fetch when using cross-fetch, replaced with n…
Browse files Browse the repository at this point in the history
…ode-fetch as dev dependency for now
  • Loading branch information
Ansonhkg committed Apr 24, 2024
1 parent 430abb7 commit 757d588
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion local-tests/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down

0 comments on commit 757d588

Please sign in to comment.