[b]"Having trouble with import from node-fetch? Common issues and fixes?"[/b] or [b]"How to properly use import fr

18 Replies, 708 Views

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!

Messages In This Thread
[b]"Having trouble with import from node-fetch? Common issues and fixes?"[/b] or [b]"How to properly use import fr - by - 22-12-2024, 05:14 PM



Users browsing this thread: 1 Guest(s)