Jammming Step 99 - Deploying with Surge Redirect Error

Hello,

I have completed the Jammming project with React, however when deploying the app with surge and updating the Redirect Uri to match the new domain (on both Spotify.js and the Spotify developers account) the response from applying a search request is as follows:

INVALID_CLIENT: Invalid redirect URI

When testing with localhost this function was returning search results successfully.

I appreciate any help you can offer.

2 Likes

I am facing the same Issue. Don’t know what’s the problem… Have you figured the way to solve the problem?I f yes, do tell me, thanks.

2 Likes

Same problem here. Ran fine on localhost, but now it throws an “illegal redirect_uri” error every time I hit search.

Fixed it… Long story short, I’m dumb.

When you construct your redirect_uri, make sure you put the http:// in front of the url provided by Surge. Then delete your build folder and start from running npm run build and go back through the remaining steps.

Make sure you change the first part of the surge url back to the original one when you re-run surge.

6 Likes

If you are using git bash on windows, I recommend you use CMD to deploy your app. Make sure to include https:// in the redirect_uri.