spotify-web-api-node icon indicating copy to clipboard operation
spotify-web-api-node copied to clipboard

TypeError: Cannot read property 'error' of null

Open synerjay opened this issue 4 years ago • 7 comments

` TypeError: Cannot read property 'error' of null _toError node_modules/spotify-web-api-node/src/http-manager.js:34 31 | }; 32 | 33 | var _toError = function(response) {

34 | if (typeof response.body === 'object' && response.body.error && typeof response.body.error === 'object' && response.body.error.reason) { 35 | return new WebapiPlayerError(response.body, response.headers, response.statusCode); 36 | } 37 | `

I keep getting these errors for spotify recommendation tracks node. Any one know how to circumvent these errors? They are getting more and frequent. What is going on?

synerjay avatar Aug 18 '21 00:08 synerjay

Hi, have you found a solution to this error?

o-laj avatar Aug 26 '21 20:08 o-laj

Hi, have you found a solution to this error?

No, but they only seem to happen when there's too many request to the spotify api. When do these errors occur for you?

synerjay avatar Aug 27 '21 01:08 synerjay

It's probably that because I'm also making a lot of requests to the Spotify API. But it seems to stop after 24hrs.

o-laj avatar Aug 27 '21 08:08 o-laj

Hi, I'm getting the same error when using the searchTracks() helper function. Have you found any solution to this yet?

davidnb3 avatar Sep 21 '21 17:09 davidnb3

still facing this issue

dewanshDT avatar May 08 '22 21:05 dewanshDT

this generally happens when we get the response code 403 which means forbidden according to Spotify's API documentation. to solve this problem just add the scope of the response you want to get in the authentication URL and it will start working.

dewanshDT avatar May 08 '22 21:05 dewanshDT

I would like to work on this Issue to throw forbidden error on 403 response code, if no one is working on this assing this to me please.

dewanshDT avatar May 08 '22 21:05 dewanshDT