vogler / free-games-claimer

Automatically claims free games on the Epic Games Store, Amazon Prime Gaming and GOG.
GNU Affero General Public License v3.0
2.21k stars 139 forks source link

PrimeGaming: Cannot read properties of null (reading 'match') #185

Closed yoshimo closed 6 months ago

yoshimo commented 11 months ago
Current DLC: VALORANT - Predicament Pals Spray
TypeError: Cannot read properties of null (reading 'match')
    at file:///fgc/prime-gaming.js:336:43
    at runNextTicks (node:internal/process/task_queues:60:5)
    at process.processImmediate (node:internal/timers:449:9)

happens for other DLCs too.

vogler commented 11 months ago

Maybe that was introduced with untested code for #180. However, looks like they also renamed [data-a-target="LinkAccountModal"] to [data-a-target="LinkAccountContainer"]:

image

What is the button's aria-label for you? I added some debug output LinkAccountButton label:. Maybe the rest of the commit already fixes it.

yoshimo commented 11 months ago
<button aria-label="Link Riot Games account" class="tw-interactive tw-button tw-button--full-width tw-button--hollow tw-button--large" data-a-target="LinkAccountButton"><span class="tw-button__text" data-a-target="tw-button-text"><div class="tw-pd-y-1"><p class="tw-font-size-5" title="Link account">Link account</p></div></span></button>
<button aria-label="Link Riot Games account" class="tw-interactive tw-button tw-button--full-width tw-button--hollow tw-button--large" data-a-target="LinkAccountButton"><span class="tw-button__text" data-a-target="tw-button-text"><div class="tw-pd-y-1"><p class="tw-font-size-5" title="Link account">Link account</p></div></span></button>
Current DLC: VALORANT - Predicament Pals Spray
locator.getAttribute: Error: strict mode violation: locator('[data-a-target="LinkAccountButton"]') resolved to 2 elements:
    1) <button data-a-target="LinkAccountButton" aria-label="Li…>…</button> aka locator('.link-account > .tw-interactive')
    2) <button role="link" class="tw-interactive tw-button" dat…>…</button> aka getByRole('link', { name: 'Link account ExternalLink' })
vogler commented 6 months ago

@yoshimo This should be fixed now, no?