fix(spotify): replace broken request-promise with native fetch#1
Open
garrettwinder wants to merge 1 commit intomasterfrom
Open
fix(spotify): replace broken request-promise with native fetch#1garrettwinder wants to merge 1 commit intomasterfrom
garrettwinder wants to merge 1 commit intomasterfrom
Conversation
The request-promise package was pinned to ^0.0.1 (a long-abandoned package whose main field points to a missing lib/tp.js), causing the server to crash at startup when lib/helpers/require-dir.js transitively loaded this file. Switch to Node's built-in fetch and simplify the gratuitous Promise wrapping around auth() and authenticateService(). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
request-promise(pinned to broken^0.0.1) with Node's built-infetchinlib/music_services/spotifyDef.jsgetOptionshelpernew Promisewrapping inauth()andauthenticateService()Why
node server.jswas crashing at startup becauselib/helpers/require-dir.jsloads every file underlib/actionsat startup, and three files transitively requiredrequest-promise. That package'smainfield points to a missinglib/tp.js, so the require blew up the whole server. Node 25 has nativefetch, so no new dependency is needed.Test plan
request-promiseblocked:node -e "..."printsrequire OK without request-promisemusicSearch.jsandsiriusXM.jsland)🤖 Generated with Claude Code