google-play-scraper icon indicating copy to clipboard operation
google-play-scraper copied to clipboard

Older projects running on commonJS cannot update to the latest google-play-scraper code base

Open j-d-carmichael opened this issue 2 months ago • 5 comments

ESM is great when possible, but we have a lot of projects running on commonJS

As a result, they cannot import properly.

Would be great to have a script to open up the ability for both options.

j-d-carmichael avatar Oct 19 '25 10:10 j-d-carmichael

This PR does exactly that: https://github.com/facundoolano/google-play-scraper/pull/722

j-d-carmichael avatar Oct 19 '25 10:10 j-d-carmichael

Check if this fixed in the latest version.

facundoolano avatar Oct 22 '25 21:10 facundoolano

It has not - not possible to import

j-d-carmichael avatar Oct 26 '25 13:10 j-d-carmichael

I will update and re-open the above pr which did work

j-d-carmichael avatar Oct 26 '25 13:10 j-d-carmichael

In case you missed it, you can use require('esm') since node v22 or v20.17.

const gplay = require("google-play-scraper");

gplay.default
  .app({ appId: "com.google.android.apps.translate" })
  .then(console.log, console.log);
// or
const { default: gplay } = require("google-play-scraper");

gplay
    .app({ appId: "com.google.android.apps.translate" })
    .then(console.log, console.log);

TonyRL avatar Nov 18 '25 01:11 TonyRL