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

Getme function doesn't work.

Open Bourhjoul opened this issue 4 years ago • 4 comments

Hey, spotifyApi.getMe().then((res) => console.log(res.body)).catch((err) => console.log(err)) this line keeps getting me this error : `TypeError: Cannot read properties of null (reading 'error') 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 | } `

If I'm not doing something the way it should, feel free to mention it.

Bourhjoul avatar Sep 06 '21 15:09 Bourhjoul

I'm getting the same error when doing this:

spotifyApi
      .searchTracks(search)
      .then((res) => {
        console.log(res);
      })
      .catch((err) => {
        console.log(err);
      });

The response is just undefined which causes the error. If anyone knows a solution please let us know :)

davidnb3 avatar Sep 22 '21 16:09 davidnb3

I have the exact same problem, I'd be grateful if anybody had a solution :)

Erayyy avatar Oct 05 '21 15:10 Erayyy

im facing the same issue, is there a solution to this?

harshalranjhani avatar Sep 15 '22 05:09 harshalranjhani

Have you added your account on the developer dashboard? Some api-calls require either the quota extension or the user's account being added on the dev dashboard.

Erayyy avatar Sep 15 '22 06:09 Erayyy