BelkaDev / Spotify-Headless

Experimental wrapper for Spotify API to search songs and control the web player using the cli (Feat. Puppeteer)
GNU General Public License v3.0
102 stars 8 forks source link

Error: Evaluation failed: TypeError: Cannot read property 'text' of null #8

Open poka-IT opened 2 years ago

poka-IT commented 2 years ago

When execute token.js, , or play.js too, I got this error:

$ node token.js 
Previous token expired or not found, generating a new one.
302
Refresh token has expired or was not retrieved.
Logging on to Spotify.
/home/poka/dev/spotify-hack/headless/node_modules/puppeteer/lib/ExecutionContext.js:66
      throw new Error('Evaluation failed: ' + helper.getExceptionMessage(exceptionDetails));
            ^

Error: Evaluation failed: TypeError: Cannot read property 'text' of null
    at <anonymous>:3:35
    at ExecutionContext.evaluateHandle (/home/poka/dev/spotify-hack/headless/node_modules/puppeteer/lib/ExecutionContext.js:66:13)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async ExecutionContext.evaluate (/home/poka/dev/spotify-hack/headless/node_modules/puppeteer/lib/ExecutionContext.js:37:20)
    at async tokenValidator.generate (/home/poka/dev/spotify-hack/headless/src/tokenValidator.js:100:21)
    at async main (/home/poka/dev/spotify-hack/headless/token.js:10:3)

I'm using node 16.15.0, same issue with node 12.

leandroembu commented 2 years ago

I have this same issue using node 16.16.0

leandroembu commented 2 years ago

The same issue using node v18.7.0

Previous token expired or not found, generating a new one.
302
Refresh token has expired or was not retrieved.
Logging on to Spotify.
/home/leandro/Spotify-Headless/node_modules/puppeteer/lib/ExecutionContext.js:66
      throw new Error('Evaluation failed: ' + helper.getExceptionMessage(exceptionDetails));
            ^

Error: Evaluation failed: TypeError: Cannot read property 'text' of null
    at <anonymous>:3:35
    at ExecutionContext.evaluateHandle (/home/leandro/Spotify-Headless/node_modules/puppeteer/lib/ExecutionContext.js:66:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async ExecutionContext.evaluate (/home/leandro/Spotify-Headless/node_modules/puppeteer/lib/ExecutionContext.js:37:20)
    at async tokenValidator.generate (/home/leandro/Spotify-Headless/src/tokenValidator.js:100:21)
    at async main (/home/leandro/Spotify-Headless/token.js:10:3)

Node.js v18.7.0