Open carlosmrtll opened 5 years ago
I want this website to be online and used by many different people, or even the same person multiple times. So I really need to solve this problem, otherwise the whole system stops working after just 3 clicks on this button.
@carlosmartell97 I started to do some digging on this and replicated your error, but I also got this:
Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
So at least we know you're overlapping requests, trying to set headers while still awaiting a response. I can look a bit more about where that's happening but hopefully that's enough to get you started. I'm sure there'll be others having the same issues with other node projects, this doesn't look to be specific to the wrapper.
+1
This happened to a productive application of mine, hundreds of users couldn't login because of an inconsistent 400 Bad Request error on Authorization Code grant.
To fix this, I just had to implement login from scratch without the spotify-web-api-node
library helper.
I'm building a page where, after clicking a button, it fetches a bunch of data from Spotify. Initially, it all works great. But if this button is clicked 3 or more times without restarting the server, I get the following error:
And I don't mean clicking the button rapidly, but rather just clicking it several times normally after it's done executing each time. Bellow I include very simple code for replicating this problem, with the following structure:
Basically, it first obtains some general info about the user. Then it gets the most recent saved songs, most recent played songs and last month's top songs for that user. For all these songs, then it fetches their respective audio features:
index.js
package.json
.env
index.html
error.html
To replicate this yourself, just do