google-play-scraper: Random mapping error.

I see that something wrong with mapping. it’s giving me that error 2 out of 3 times, it’s kind of strange:

TypeError: Cannot read property 'replace' of undefined
at Object.descriptionText [as fun] (/node_modules/google-play-scraper/lib/mappers/details.js:125:51)
at //node_modules/google-play-scraper/lib/utils/scriptData.js:52:19
at XWrap.f (/node_modules/ramda/dist/ramda.js:5955:28)

@facundoolano would be great if you check what could be wrong with that… Thanks.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 21 (8 by maintainers)

Most upvoted comments

@Giszmo @VitaliyRDev PR #498 is up for review

Hey everyone, I’ll also take a look at this now

> const gplay = require('google-play-scraper')
> gplay.app({appId: 'se.pax.calima', lang: 'en', country: 'fr'}).then((res) => console.log(res))
Promise {
  <pending>,
  [Symbol(async_id_symbol)]: 82,
  [Symbol(trigger_async_id_symbol)]: 70,
  [Symbol(destroyed)]: { destroyed: false }
}
> Uncaught TypeError: Cannot read properties of undefined (reading 'replace')
    at Object.descriptionText [as fun] (/home/leo/StudioProjects/giszmo.github.io/node_modules/google-play-scraper/lib/mappers/details.js:125:51)
    at /home/leo/StudioProjects/giszmo.github.io/node_modules/google-play-scraper/lib/utils/scriptData.js:52:19
    at XWrap.f (/home/leo/StudioProjects/giszmo.github.io/node_modules/ramda/dist/ramda.js:5955:28)
    at XWrap.@@transducer/step (/home/leo/StudioProjects/giszmo.github.io/node_modules/ramda/dist/ramda.js:392:25)
    at _arrayReduce (/home/leo/StudioProjects/giszmo.github.io/node_modules/ramda/dist/ramda.js:5137:46)
    at _reduce (/home/leo/StudioProjects/giszmo.github.io/node_modules/ramda/dist/ramda.js:5167:24)
    at map (/home/leo/StudioProjects/giszmo.github.io/node_modules/ramda/dist/ramda.js:5954:20)

Using many country codes here for thousands of apps, I’m heavily affected, too.

@facundoolano when will npm get an update? I thought it would be easy to just use the project as git submodule but somehow I had issues and now have issues again and imagine others are in the same boat and it’s been 3 days, …

first my jsminify tried to minify this project and now an exception behaves differently than when using the npm package. I’ll try to fix that for my project but a fast update of npm would certainly be appreciated not just by me.

@icarcal excellent! I think this does the job for me. Didn’t test with all 2000 apps but the ones causing issues before now work.

@89z are you implying the above code works for you if you filter (how?) for certain fields? Either way it’s a bug that needs to be fixed.

@89z

gplay.app({appId: 'se.pax.calima', lang: 'en', country: 'fr'}).then((res) => console.log(res)); for country us it’s working totally fine. it seems they have changed mapping but only for particular countries.

but some other apps don’t work in us country code either.