baltpeter / parse-play

Library for fetching and parsing select data on Android apps from the Google Play Store via undocumented internal APIs.
MIT License
24 stars 2 forks source link

"require() of ES Module not supported" #7

Closed ESeufert closed 1 year ago

ESeufert commented 1 year ago

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.

baltpeter commented 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.

baltpeter commented 1 year ago

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.