fetch vs node-fetch in Next.js api #820
-
|
Hi all! Ok, I think this might be a silly question but I finally have an API all testing properly BUT I've had to import node-fetch in my api, when I don't need to do this when simply running the api in Next.js + Vercel. I'm not sure why Next.js/Vercel don't seem to mind simply using Simply put: I can run my api without Any help or input would be greatly appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
This does indeed sound like something to do with later Node versions with built-in fetch vs older Node versions that rely on third-party fetch. It could be the case that the If you make a minimal reproducible example I can take a look. |
Beta Was this translation helpful? Give feedback.
This does indeed sound like something to do with later Node versions with built-in fetch vs older Node versions that rely on third-party fetch. It could be the case that the
node-fetchpackage does something that disables the built-in fetch, or that Node disables built-in fetch when it detects one of the third party fetch libraries, but I haven't seen any documentation that describes such behavior from Node or thenode-fetchpackage.If you make a minimal reproducible example I can take a look.