Type in your question below and we'll check to see what answers we can find...
Loading article...
Submitting...
If you couldn't find any answers in the previous step then we need to post your question in the community and wait for someone to respond. You'll be notified when that happens.
Simply add some detail to your question and refine the title if needed, choose the relevant category, then post.
Before we can post your question we need you to quickly make an account (or sign in if you already have one).
Don't worry - it's quick and painless! Just click below, and once you're logged in we'll bring you right back here and post your question. We'll remember what you've already typed in so you won't have to do it again.
Please see below the most popular frequently asked questions.
Loading article...
Loading faqs...
Please see below the current ongoing issues which are under investigation.
Loading issue...
Loading ongoing issues...
My Question or Issue
I recently made a small web application using the Spotify API. The app was made in the relatively newly announced development mode. After I finished making the app, I added a few people to the Users and Access list. It worked fine. As I wanted unlimited users to use it, I requested a quota extension. It was approved and the Users and Access tab became grey.
BUT, the problem which arose was that ONLY the people I added in the Users and Access list can access the website even now after the request was approved. If someone not on the list accesses the website, the whole website crashes as Spotify doesn't give access to that person. I can't even edit the Users and Access list as its greyed out. I don't understand what's going on.
Someone, please help me out in this
https://graphin-tunes.herokuapp.com/ - Here's the website.
Solved! Go to Solution.
From the screenshot you linked this isn't a case of the APIs not working or giving errors for the specific user - it's because there is no data for recently played for that specific user. This could be caused by a number of things such a private sessions or simply that you are using a test user that has no listening history?
Hi there
I'm sorry to hear you're experiencing issues after getting your quota extension request approved. I have just tried to log in to your app to see if I could get a read on some errors but the app crashed.
Can you provide some more details? You must be seeing some errors somewhere from the Spotify APIs? Typically this should manifest itself with HTTP 403 "User not approved for app" error. Can you give some more details?
So I checked the logs of this error, and the problem which unfolds is that the data is undefined. The app tries to access a property of an undefined object, hence the app shuts down gracefully. I also checked the headers associated and the status code which arises is 503 Service Unavailable.
This only happens for users I had not added to the Users and Access list before the quota extension was approved.
Also, another thing is that when a new user logs in onto the website, Spotify logs the user in, however doesn't send the data requested to my application, hence causing it to crash.
I've had the team check the app from our end and everything seems to be working as expected. I also just logged in with my own user to your app which worked fine - and I wasn't added to your app prior to your extension request ๐
I can't really give much insights into your app and the crash but it sounds like you need to handle errors more gracefully so it doesn't completely crash?
In order to help troubleshoot further we need to know exactly what APIs you're calling and what errors/data you're getting from them. You mention "however doesn't send the data requested to my application" - can you elaborate on this? Which APIs are you calling and what's the result? Any errors? What was the expected result?
Yes, I need to improve my error handling, because it is pretty terrible right now๐ .
I am calling the Web API and this is the error I get from the logs:
TypeError: Cannot read property 'name' of undefined
So it seems that Spotify does log the new user in, but doesn't send any data back to the client. The status code I receive on the app is "503 Service Unavailable".
When I log in using one of the users I added prior to the extension, I receive an array, each element of that array is an object having all the audio features. I don't think it's an issue related to the code, as the website loads perfectly for added users. I am also unsure whether the problem arises on my part or if it is a bug in the API?
For me, it still seems to crash when I log in as a new user.๐ฅ
Okay, so this error
TypeError: Cannot read property 'name' of undefined
Is coming from your application, not the Web API.
Which API (URL) are you calling? Basically I'm trying to figure out which API calls you're making to the Spotify Web API and what errors you're getting from the Web API.
I am using the Spotify Web API node wrapper on npm.
The API endpoints are for getting the current User - https://developer.spotify.com/console/get-current-user/
getting the recently played songs - https://developer.spotify.com/console/get-recently-played/
The Web API request just shows pending for a while and shows the aforementioned status code.
Also I am using heroku free dynos to deploy the app. Is that a problem?
I tried using the console, and it's not working on the account I didn't add, however, it works fine on the account added before the extension. I have attached a screenshot for some more details on this link "https://ibb.co/Tts9vQP". The link is for the result of the users not added before.
Here's the sample code:
https://paste.ofcode.org/RnegJ5j5riCSYFtj8CWLDQ
From the screenshot you linked this isn't a case of the APIs not working or giving errors for the specific user - it's because there is no data for recently played for that specific user. This could be caused by a number of things such a private sessions or simply that you are using a test user that has no listening history?
Well, I checked the Spotify account and it turns out private session was on. This was a silly and hard to debug issue, I guess๐ . I then disabled it, and listened to a few songs. The app crashed again, but after checking the logs, I realised it was due to really bad error handling on my part.๐
Thank you so much for taking the time to help out junior devs like me, it really means a lot to us, especially when we're just starting out.๐
Hey there you, ย Yeah, you!ย 😁 ย Welcome - we're glad you joined the Spotify Community! ย While you here, let's have a fun game and getโฆ