claabs / epicgames-freegames-node

Automatically login and find available free games the Epic Games Store. Sends you a prepopulated checkout link so you can complete the checkout after logging in. Supports multiple accounts, login sessions, and scheduled runs.
https://hub.docker.com/r/charlocharlie/epicgames-freegames
MIT License
1.35k stars 92 forks source link

Cannot read property 'elements' of null #79

Closed simphide closed 3 years ago

simphide commented 3 years ago

Describe the bug The process crashed while refreshing the login...

Screenshots or Logs

> epicgames-freegames-node@3.0.0 start /usr/app,
> node dist/src/index.js,
,
[2021-01-18 12:00:02.733 +0100] INFO  (160 on 7c476f477d9b): Checking free games for firstaccount@mail.com ,
[2021-01-18 12:00:10.865 +0100] INFO  (160 on 7c476f477d9b): Successfully refreshed login,
    user: "firstaccount@mail.com",
[2021-01-18 12:00:12.661 +0100] ERROR (160 on 7c476f477d9b): Cannot read property 'elements' of null,
    TypeError: Cannot read property 'elements' of null,
        at Object.transform (/usr/app/src/free-games.ts:93:59),
        at Function.paginate (/usr/app/node_modules/got/dist/source/create.js:146:45),
        at processTicksAndRejections (internal/process/task_queues.js:97:5),
        at AsyncGeneratorFunction.got.paginate.all (/usr/app/node_modules/got/dist/source/create.js:178:26),
        at FreeGames.getCatalogFreeGames (/usr/app/src/free-games.ts:84:19),
        at FreeGames.getAllFreeGames (/usr/app/src/free-games.ts:347:24),
        at /usr/app/src/index.ts:21:22,
        at async Promise.all (index 0),
        at main (/usr/app/src/index.ts:31:3),
[2021-01-18 12:01:02.778 +0100] INFO  (160 on 7c476f477d9b): Checking free games for secondaccount@mail.com ,
[2021-01-18 12:01:11.261 +0100] INFO  (160 on 7c476f477d9b): Successfully refreshed login,
    user: "secondaccount@mail.com",
[2021-01-18 12:01:22.560 +0100] INFO  (160 on 7c476f477d9b): Available free games,
    user: "secondaccount@mail.com",
    availableGames: [,
      "Sludge Life",,
      "STAR WARS™ Battlefront™ II: Celebration Edition",
    ],
[2021-01-18 12:01:24.411 +0100] INFO  (160 on 7c476f477d9b): Unpurchased free games,
    user: "secondaccount@mail.com",
    purchasableGames: [],

I'm running the latest version

claabs commented 3 years ago

It failed in the pagination function for the games list. It looks like it worked on your second account, though. I'm also not seeing the error, so it may have just been a fluke from Epic's API. Let me know if you see it again.

simphide commented 3 years ago

Didn't appear anymore

icenoir commented 1 month ago

it's happening the same error to me at every run. Is it because Epic Games Store layout changed?