How to make a fetch request using node-fetch v3
Blog post from Netlify
I've been working on a project using Astro and had an issue with node-fetch v3 not working in my Netlify Serverless Functions, which was caused by a breaking change that made the module no longer compatible with CommonJS. To resolve this issue, I had to update my import statement from `require()` to `import` and also updated my `netlify.toml` file or added `"type": "module"` to my `package.json`, which allows Netlify to recognize the ESM module and fix the error. With these updates, my fetch request is now working as expected.
| Trend | Post Mentions | Total Month Mentions | Posts | Companies | MoM |
|---|---|---|---|---|---|
| Serverless | 1 | 704 | 112 | 54 | -13% |
Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.