Length of playlist returned by getUserPlaylists() is 0.
Kumar2106 opened this issue · comments
Describe the bug
I am coding clone of spotify app. I am using this spotify-web-api-js. In my code where i am trying to fetch user playlist it is returning me items of length 0. i will be attaching the code and the screenshot of the inspector tool.
To Reproduce
Steps to reproduce the behavior:
- const spotify = new SpotifyWebApi();
- spotify.setAccessToken(_token);
- spotify.getUserPlaylists().then((playlist) => {
console.log("fetching playlist " + playlist);
console.table("The playlist item is " + playlist.items);
//dispatch function is basically context api used for state management.
dispatch({
type: "SET_PLAYLIST",
playlists: playlist,
});
});
Expected behavior
getUserPlaylists() function should return playlist of a user.
Desktop (please complete the following information):
- Ubuntu 20.04
- Firefox
- 88.0.1
Additional context
Add any other context about the problem here.
Any updates for this issue ?
@AndreiMihaiSurueanu did you end up finding the issue? this can be either that you haven't requested the right scope, or that the user doesn't have any public playlists. In any case, it's not an issue of this library itself, so I'll close this issue for now.