Company
Date Published
Author
Tatyana Novell
Word count
573
Language
English
Hacker News points
None

Summary

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.