Skip to content

Commit

Permalink
Fix: Replace node-fetch with isomorphic-fetch to resolve issue
Browse files Browse the repository at this point in the history
  • Loading branch information
sumanjeet0012 committed Jan 30, 2025
1 parent d97088d commit 4cbb279
Show file tree
Hide file tree
Showing 3 changed files with 2,651 additions and 242 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,11 @@ the `--allow-net` flag e.g. `deno run --allow-net client.js`.

### Node.js

If you'd like to run it in Node.js, add a fetch polyfill such as [`node-fetch`](http://npm.im/node-fetch)
If you'd like to run it in Node.js, add a fetch polyfill such as [`isomorphic-fetch`](http://npm.im/isomorphic-fetch)
and [`AbortController`](http://npm.im/abort-controller) as globals e.g.

```js
import fetch from 'node-fetch'
import fetch from 'isomorphic-fetch'
import AbortController from 'abort-controller'

global.fetch = fetch
Expand All @@ -160,7 +160,7 @@ global.AbortController = AbortController
**From common.js:**

```js
const fetch = require('node-fetch')
const fetch = require('isomorphic-fetch')
const AbortController = require('abort-controller')

global.fetch = fetch
Expand Down
Loading

0 comments on commit 4cbb279

Please sign in to comment.