TypeError: spotifyApi.createAuthorizeURL is not a function
See original GitHub issueI recently my project (that has been dormant for a while) from version 4.0.0 to version 5.0.0 of your wonderful project.
It seemed to work fine at first, but when running the frontend, it get an TypeError: spotifyApi.createAuthorizeURL is not a function
.
I have initialised the library as below:
const spotifyApi = new SpotifyWebApi({
clientId: process.env.REACT_APP_SPOTIFY_CLIENT_ID,
redirectUri: redirectUri,
});
export default spotifyApi;
export const createAuthorizeURL = (): string => {
const newState = generateRandomString(16);
localStorage.setItem('authState', newState);
return spotifyApi.createAuthorizeURL(scopes, newState);
};
I could not find anything about this specific error in the changelog, existing issues or the current documentation. Did I miss anything?
If I downgrade to 4.0.0 again it works without any other change.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:10
- Comments:7
Top Results From Across the Web
Displaying permissions with spotify-web-api-node
Correct, Im using the createAuthorizeURL. It's as follows 'var authorizeURL = spotifyApi.createAuthorizeURL(scopes);'. Where scopes is an array ...
Read more >spotify-web-api-node.SpotifyWebApi.createAuthorizeURL ...
Creates URL for users to authenticate * @param {String[]} scopes * @param {String} state * @return {String} authorizeUrl */ createAuthLink(scopes,state ...
Read more >Cannot authenticate to Spotify API with Node.JS app
My problem is that I cannot obtain an access token with the /authorize endpoint. Here's my code : function getToken() ...
Read more >spotify-web-api-node - npm
// Get Elvis' albums spotifyApi.getArtistAlbums('43ZHCT0cAZBISjO8DG9PnE').then( function( ...
Read more >JavaScript : 'TypeError: is not a function' in Node.js - YouTube
JavaScript : ' TypeError : is not a function ' in Node.js [ Gift : Animated Search Engine : https://bit.ly/AnimSearch ] JavaScript ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for sharing this code. Can you tell me how can i add this in reactjs as it is js not Typescript?
Looks like the server methods are missing. This is my 1am fix if you don’t want to downgrade:
(taken from source: https://github.com/thelinmichael/spotify-web-api-node/blob/2785f79d58a9017e9f57fbb0f06e6d23022fd3b4/src/server.js) Obviously this is an unofficial fix and may break in the future. (works for 5.0.2)