Jammming after every search page reloads data vanishes

I completed the Jamming project and was able to build it with surge. Here is the link to App:

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 vanishes(even the tracks added to playlist) when I search for the second time. 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. Even when I try to save the playlist the page refreshes and nothing happens.
I have checked the entire code and was unable to figure it out.

Is there a way to avoid it?

1 Like

Hi @b_ma I also have the same problem and I think I have seen a few posts about it. If you find the solution please let me know and I will do the same!


Post on Stackflow, bottom part of the first post talks about refresh problem and possible fix.

I just found this. It talks about an API change, unable to test this myself atm.

Hi all,

I am running into the same issue http://save2spotify.surge.sh
and I can’t find the solution.

In addition, have you noticed that the playlistname doesn’t revert back to ‘New Playlist’ after saving a playlist even though the savePlaylist() method has a setState to update it? Any ideas how or why?

One problem solved: reseting the playlistname after saving a playlist:

  1. replace initial state in App.js with ‘New Playlist’; and
  2. in Playlist.js replace defaultValue=‘New Playlist’ in <input…> with value={this.props.playlistName}
1 Like

thanks. Has anyone found solutions for the other issues?