Having trouble with import from node-fetch? Common issues and fixes? or How to properly use import fr

18 Replies, 714 Views

ugh, node-fetch can be such a pain sometimes.

Try adding `--experimental-modules` flag when running your script if you're on an older Node version.

Also, make sure your file extension is `.mjs` if you're using modules. Or just stick with `.js` and keep `"type": "module"` in package.json.

Messages In This Thread



Users browsing this thread: 1 Guest(s)