Error aftering updating to 14.9.0

I like to use my own builders to help me develop using the discord.js framework. In my embed builder I have
toJSON() {
return this.toJSON()
};
toJSON() {
return this.toJSON()
};
After updating this is throwing the following error.
RangeError: Maximum call stack size exceeded
at Embed.toJSON (C:\Users\braxt\Documents\GitHub\fanta\src\structure\backend\build.js:166:25)
RangeError: Maximum call stack size exceeded
at Embed.toJSON (C:\Users\braxt\Documents\GitHub\fanta\src\structure\backend\build.js:166:25)
Was there a major change I should know of that I need to reflect in my builder?
5 Replies
d.js toolkit
d.js toolkit14mo ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
Syjalo
Syjalo14mo ago
That's just a recursive method If you want to call .toJSON() of the parent then use super.toJSON()
PlutoTheDev
PlutoTheDev14mo ago
Tried that, using super gives me this error
TypeError: (intermediate value).toJSON is not a function
at Embed.toJSON (C:\Users\braxt\Documents\GitHub\fanta\src\structure\backend\build.js:166:26)
at C:\Users\braxt\Documents\GitHub\fanta\node_modules\discord.js\src\structures\MessagePayload.js:202:40
at Array.map (<anonymous>)
at MessagePayload.resolveBody (C:\Users\braxt\Documents\GitHub\fanta\node_modules\discord.js\src\structures\MessagePayload.js:201:36)
at ThreadChannel.send (C:\Users\braxt\Documents\GitHub\fanta\node_modules\discord.js\src\structures\interfaces\TextBasedChannel.js:153:61)
at Query.<anonymous> (C:\Users\braxt\Documents\GitHub\fanta\modules\Tickets\src\loop.js:28:29)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
TypeError: (intermediate value).toJSON is not a function
at Embed.toJSON (C:\Users\braxt\Documents\GitHub\fanta\src\structure\backend\build.js:166:26)
at C:\Users\braxt\Documents\GitHub\fanta\node_modules\discord.js\src\structures\MessagePayload.js:202:40
at Array.map (<anonymous>)
at MessagePayload.resolveBody (C:\Users\braxt\Documents\GitHub\fanta\node_modules\discord.js\src\structures\MessagePayload.js:201:36)
at ThreadChannel.send (C:\Users\braxt\Documents\GitHub\fanta\node_modules\discord.js\src\structures\interfaces\TextBasedChannel.js:153:61)
at Query.<anonymous> (C:\Users\braxt\Documents\GitHub\fanta\modules\Tickets\src\loop.js:28:29)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
My method works just fine in one spot that I send and embed to the thread channel, but not the next It doesn't extend anything, I'll get you a paste bin of it
PlutoTheDev
PlutoTheDev14mo ago
Untitled - Pastebin
Pastebin.pl is a website where you can store code/text online for a set period of time and share to anybody on earth
PlutoTheDev
PlutoTheDev14mo ago
What exactly is Discord.JS looking for when they call the toJSON()? Fixed it by just returning this.data