Discordjs REST error iirc

Unhandled Rejection at: Promise { <rejected> } Reason: 261 | return params;
262 | }
263 | __name(makeURLSearchParams, "makeURLSearchParams");
264 | async function parseResponse(res) {
266 | return res.json();
^
SyntaxError: Unexpected end of JSON input
at C:\Users\komono\node_modules\@discordjs\rest\dist\index.js:266:16
at parseResponse (C:\Users\komono\node_modules\@discordjs\rest\dist\index.js:264:30)
Unhandled Rejection at: Promise { <rejected> } Reason: 261 | return params;
262 | }
263 | __name(makeURLSearchParams, "makeURLSearchParams");
264 | async function parseResponse(res) {
266 | return res.json();
^
SyntaxError: Unexpected end of JSON input
at C:\Users\komono\node_modules\@discordjs\rest\dist\index.js:266:16
at parseResponse (C:\Users\komono\node_modules\@discordjs\rest\dist\index.js:264:30)
I've been getting this error randomly when i start my bot since i updated djs
6 Replies
d.js toolkit
d.js toolkit6mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
Mark
Mark6mo ago
why did you make a thread with no new details or acknowledgement of what you've already been told?
᲼
OP6mo ago
Because i was told to make a thread so the issue dont get lost
Mark
Mark6mo ago
with no new details or acknowledgement of what you've already been told?
this way other people don't come in and do the same steps you've already gone through
᲼
OP6mo ago
I tried all they told me to do to get more information with no result I dont know what else u expect me to do The best i can think of is saying "Couldnt verify discordjs rest version"
zeing
zeing4w ago
I found this as well no clue I found this error as well. I’m trying to find the root cause, but I have no idea. Yes, I tried searching for this keyword in the server, but no one else has faced this error. 😭 "discord.js": "^14.17.3",
process.on('unhandledRejection', (reason, promise) => {
console.error('Unhandled promise rejection:', reason, promise)
process.on('unhandledRejection', (reason, promise) => {
console.error('Unhandled promise rejection:', reason, promise)
Unhandled promise rejection:
259 | if (serialized !== null) params.append(key, serialized);
260 | }
261 | return params;
262 | }
263 | __name(makeURLSearchParams, "makeURLSearchParams");
264 | async function parseResponse(res) {
^
SyntaxError: Unexpected end of JSON input
at parseResponse (...../node_modules/@discordjs/rest/dist/index.js:264:30)
Promise { <rejected> }
Unhandled promise rejection:
259 | if (serialized !== null) params.append(key, serialized);
260 | }
261 | return params;
262 | }
263 | __name(makeURLSearchParams, "makeURLSearchParams");
264 | async function parseResponse(res) {
^
SyntaxError: Unexpected end of JSON input
at parseResponse (...../node_modules/@discordjs/rest/dist/index.js:264:30)
Promise { <rejected> }
Do you have any ideas for debugging? I am trying but I have no idea where have to handle I have tried to handle all .reply , .editReply , .edit , .send ok I will try

Did you find this page helpful?