Why doesn't fetch in Node.js work out of the box? What's the best alternative? or How do I use fetch

14 Replies, 792 Views

Honestly, the simplest fix rn is undici. It’s literally fetch for nodejs, just not global by default.

```js
import { fetch } from 'undici';
```

Axios is overkill unless you need it. node-fetch is dead. undici is the answer.

Messages In This Thread



Users browsing this thread: 1 Guest(s)