You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the same credentials, it fails with this error:
$ node dist/index.js
Searching Spotify for The Beatles...
/Users/courtschuett/Documents/GitHub/schuettc/spotify-discover-weekly-saver/node_modules/@spotify/web-api-ts-sdk/dist/cjs/auth/ClientCredentialsStrategy.js:59
throw new Error("Failed to get access token.");
^
Error: Failed to get access token.
at ClientCredentialsStrategy.getTokenFromApi (/Users/courtschuett/Documents/GitHub/schuettc/spotify-discover-weekly-saver/node_modules/@spotify/web-api-ts-sdk/dist/cjs/auth/ClientCredentialsStrategy.js:59:19)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async /Users/courtschuett/Documents/GitHub/schuettc/spotify-discover-weekly-saver/node_modules/@spotify/web-api-ts-sdk/dist/cjs/auth/ClientCredentialsStrategy.js:24:27
at async InMemoryCachingStrategy.getOrCreate (/Users/courtschuett/Documents/GitHub/schuettc/spotify-discover-weekly-saver/node_modules/@spotify/web-api-ts-sdk/dist/cjs/caching/GenericCache.js:27:30)
at async ClientCredentialsStrategy.getOrCreateAccessToken (/Users/courtschuett/Documents/GitHub/schuettc/spotify-discover-weekly-saver/node_modules/@spotify/web-api-ts-sdk/dist/cjs/auth/ClientCredentialsStrategy.js:23:23)
at async SpotifyApi.makeRequest (/Users/courtschuett/Documents/GitHub/schuettc/spotify-discover-weekly-saver/node_modules/@spotify/web-api-ts-sdk/dist/cjs/SpotifyApi.js:75:33)
at async SearchEndpoints.getRequest (/Users/courtschuett/Documents/GitHub/schuettc/spotify-discover-weekly-saver/node_modules/@spotify/web-api-ts-sdk/dist/cjs/endpoints/EndpointsBase.js:9:16)
at async SearchEndpoints.execute (/Users/courtschuett/Documents/GitHub/schuettc/spotify-discover-weekly-saver/node_modules/@spotify/web-api-ts-sdk/dist/cjs/endpoints/SearchEndpoints.js:10:16)
Node.js v20.5.1
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
The text was updated successfully, but these errors were encountered:
Attempting to create a NodeJS app using
SpotifyApi.withClientCredentials
. When creating with JavaScript, the example here works just fine.However, when attempting using Typescript, it fails.
Using the same credentials, it fails with this error:
The text was updated successfully, but these errors were encountered: