Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/web/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module.exports = async () => {
...nextJestConfig,
transformIgnorePatterns: [
// Transform all node_modules except the ones below
'node_modules/(?!(.*\\.mjs$|@coinbase/onchainkit|wagmi|@wagmi|viem|node-fetch|data-uri-to-buffer|fetch-blob|formdata-polyfill|graphql-request|cross-fetch|is-ipfs|uint8arrays|multiformats|@multiformats|iso-url))',
'node_modules/(?!(.*\\.mjs$|@coinbase/onchainkit|wagmi|@wagmi|viem|node-fetch|whatwg-fetch|data-uri-to-buffer|fetch-blob|formdata-polyfill|graphql-request|cross-fetch|is-ipfs|uint8arrays|multiformats|@multiformats|iso-url))',
],
};
};
1 change: 1 addition & 0 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
"uuid": "^10.0.0",
"viem": "2.x",
"wagmi": "2.17.5",
"whatwg-fetch": "^3.6.20",
"zustand": "^5.0.5"
},
"devDependencies": {
Expand Down
12 changes: 2 additions & 10 deletions apps/web/scripts/helpers/fetchPolyfill.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
// fetch-polyfill.js
function fetch(...args) {
return import('node-fetch').then(({ default: _fetch }) => _fetch(...args));
}

if (!globalThis.fetch) {
globalThis.fetch = fetch;
globalThis.Headers = fetch.Headers;
globalThis.Request = fetch.Request;
globalThis.Response = fetch.Response;
}
// Polyfill fetch for Node.js environments using whatwg-fetch
require('whatwg-fetch');
1 change: 0 additions & 1 deletion apps/web/src/cdp/utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { cdpBaseUri } from 'apps/web/src/cdp/constants';
import { generateCdpJwt } from 'apps/web/src/cdp/jwt';
import { Response } from 'node-fetch';

export async function cdpGet(endpoint: string, authed: boolean): Promise<Response> {
const headers = new Headers();
Expand Down
3 changes: 2 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ __metadata:
uuid: ^10.0.0
viem: 2.x
wagmi: 2.17.5
whatwg-fetch: ^3.6.20
zustand: ^5.0.5
languageName: unknown
linkType: soft
Expand Down Expand Up @@ -23382,7 +23383,7 @@ __metadata:
languageName: node
linkType: hard

"whatwg-fetch@npm:^3.4.1":
"whatwg-fetch@npm:^3.4.1, whatwg-fetch@npm:^3.6.20":
version: 3.6.20
resolution: "whatwg-fetch@npm:3.6.20"
checksum: c58851ea2c4efe5c2235f13450f426824cf0253c1d45da28f45900290ae602a20aff2ab43346f16ec58917d5562e159cd691efa368354b2e82918c2146a519c5
Expand Down
Loading