Title: Having trouble with import from node-fetch? Let's figure it out
Hey folks,
So I’ve been trying to use import from node-fetch in my project, but it’s just not playing nice.
Sometimes it throws this weird error like *"Cannot use import statement outside a module"* or just straight-up refuses to work.
Anyone else run into this?
I’ve tried:
- Adding `"type": "module"` to package.json
- Using require() instead, but that feels outdated
- Reinstalling node-fetch, just in case
Still no luck. Am I missing something obvious?
Would love to hear how you guys got import from node-fetch working smoothly.
Thanks in advance!
Hey folks,
So I’ve been trying to use import from node-fetch in my project, but it’s just not playing nice.
Sometimes it throws this weird error like *"Cannot use import statement outside a module"* or just straight-up refuses to work.
Anyone else run into this?
I’ve tried:
- Adding `"type": "module"` to package.json
- Using require() instead, but that feels outdated
- Reinstalling node-fetch, just in case
Still no luck. Am I missing something obvious?
Would love to hear how you guys got import from node-fetch working smoothly.
Thanks in advance!
