Spotify Access Token Fetch Error

I'm currently encountering an issue while using Moonlink.js with Spotify support. Here's the error log:
/root/Moon/node_modules/moonlink.js/dist/src/sources/Spotify.js:56
throw new Error('Failed to fetch Spotify access token');
^
Error: Failed to fetch Spotify access token
at Spotify.initTokens (/root/Moon/node_modules/moonlink.js/dist/src/sources/Spotify.js:56:19)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
Node.js v22.16.0
/root/Moon/node_modules/moonlink.js/dist/src/sources/Spotify.js:56
throw new Error('Failed to fetch Spotify access token');
^
Error: Failed to fetch Spotify access token
at Spotify.initTokens (/root/Moon/node_modules/moonlink.js/dist/src/sources/Spotify.js:56:19)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
Node.js v22.16.0
No description
29 Replies
1Lucas1.apk
1Lucas1.apk3mo ago
Since it's early morning where I live, I'll do a hotfix on this in about 8 hours. Thanks for reporting
INSANE17?.!!
INSANE17?.!!OP3mo ago
Thanks
UnschooledGamer
UnschooledGamer3mo ago
It's endpoint got changed 🙃 Also the reason param in the url.
Drac
Drac3mo ago
hey just wanted to know if this is fixed sorry for the ping @1Lucas1.apk
UnschooledGamer
UnschooledGamer3mo ago
Just 3 hours passed
Drac
Drac3mo ago
Okay Thanks for the reply
UnschooledGamer
UnschooledGamer3mo ago
GitHub
fix: Spotify endpoint change · Ecliptia/moonlink.js@1e3594a
Signed-off-by: Emmanuel Lobo <76094069+UnschooledGamer@users.noreply.github.com>
INSANE17?.!!
INSANE17?.!!OP3mo ago
Is it fixed ?
UnschooledGamer
UnschooledGamer3mo ago
As per my testing yes. Lucas Will check & release He should be here anytime in some hours
INSANE17?.!!
INSANE17?.!!OP3mo ago
waiting for him :Basu_PandaEatingChips:
UnschooledGamer
UnschooledGamer3mo ago
might have gotta held IRL works.
INSANE17?.!!
INSANE17?.!!OP3mo ago
Yeah
UnschooledGamer
UnschooledGamer3mo ago
you can install that version. But I can't ensure it might have everything as dev & main branch are not synced. 6 commits behind v4.(v4 = current main branch)
INSANE17?.!!
INSANE17?.!!OP3mo ago
Nah, I'll wait until the release.
MEE6
MEE63mo ago
GG @INSANE17?.!!, you just advanced to level 1!
1Lucas1.apk
1Lucas1.apk3mo ago
The internet cables broke in the street because of a tree now that they finished fixing them Sorry for the delay
UnschooledGamer
UnschooledGamer3mo ago
wait
1Lucas1.apk
1Lucas1.apk3mo ago
Thanks for fixing it, you're awesome ✌🏽
UnschooledGamer
UnschooledGamer3mo ago
don't publish I forgot to change embed to web-player
1Lucas1.apk
1Lucas1.apk3mo ago
I still need to remove these errors that cause these fatal errors, let it automatically disable when the source cannot obtain this necessary information.
UnschooledGamer
UnschooledGamer3mo ago
hmm, just warning it. with console.warn or process.warning
1Lucas1.apk
1Lucas1.apk3mo ago
To publish, just put the version in package.json and a release on github Sometimes there are people who don't like logs, so I think I'll send it through some event, I think through debug
UnschooledGamer
UnschooledGamer3mo ago
you should warn to my guess. As else User will need to dig down. a process.warning or warn can be handled. you can suppress them with a flag/option
1Lucas1.apk
1Lucas1.apk3mo ago
Then I will send it through console.warn I made an option to disable it and realized that it is not working. I will have to fix that too.
INSANE17?.!!
INSANE17?.!!OP3mo ago
@1Lucas1.apk hey ! Good to see you !
ComicallyBad
ComicallyBad3mo ago
Hey, so I'm still getting this error with the latest version, is it still an issue atm with moonlink? Or could it be my application.yml needs to be updated? edit* not getting that error anymore sorry, but I'm getting: TypeError: Body is unusable: Body has already been read yeah, commenting Spotify out from the application.yml fixed it lol, spotify is working now
1Lucas1.apk
1Lucas1.apk3mo ago
This is because of fetch, I'll soon rewrite makeRequest to http
ComicallyBad
ComicallyBad3mo ago
So does moonlink not need lavasrc? Seems to work fine with lavasrc Spotify configuration disabled
1Lucas1.apk
1Lucas1.apk3mo ago
Since last month I introduced a dynamic sourceManager and added support for Spotify and Deezer natively, but it needs a default source to stream

Did you find this page helpful?