Closed ESeufert closed 1 year ago
What version of Node are you using? And can you give minimum reproducible example of your code?
I just tried the example from the README in Node 14, 16, and 18 and couldn't reproduce that error.
Oh, another thought: Are you using a bundler? I'm depending on cross-fetch
, which in turn depends on node-fetch
for Node. And as you said, node-fetch
doesn't support CSM anymore. So you need to make sure to transpile to ESM.
I'm getting an error when trying to run this:
"Error [ERR_REQUIRE_ESM]: require() of ES Module...not supported."
According to Stack Overflow, node-fetch v3 removed support for require() in favor of ES Modules.