I completed the Jamming project and was able to build it with surge. The link to this app is: http://time-to-jam.surge.sh/ .
My issue is that after a user authenticates their Spotify account and then refreshes the page, the first search results in a list of songs that then vanish or they don’t appear at all. However after this first search all of the songs show up as they should from there on out. Only after a user refreshes the page and tries to search again does stuff vanish or the page refreshes itself.
I found another classmates project on Github and opened it and found that they also had the same issue. Is there a way to avoid this?
hi Alex,
AJAX requests like fetch() are cached by browsers. To check this try input a new name of song or artist which you have never inputted before, you will see the error.
You can run an empty search the first time, which will reload the page and allow you to search with no problems. Knowing this, I chose to force an empty search automatically when the page loads by adding the following code to the App component:
I am facing the same problem. I am pretty sure i have written the correct code. Whenever i search for a track, it shows the tracklist the first time but it immediately disappears, and i can’t search for any other track for some time.
Can anyone help?