#Error aftering updating to 14.9.0

11 messages · Page 1 of 1 (latest)

silver nova
#

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()
        };

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)

Was there a major change I should know of that I need to reflect in my builder?

heavy fieldBOT
#

• 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.

raven mulch
#

That's just a recursive method

#

If you want to call .toJSON() of the parent then use super.toJSON()

silver nova
#

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)
#

My method works just fine in one spot that I send and embed to the thread channel, but not the next

edgy fossil
silver nova
#

It doesn't extend anything, I'll get you a paste bin of it

edgy fossil
#

Then there’s no super you can call toJSON() of. So your whole toJSON() will have to be implemented by you

silver nova
#

What exactly is Discord.JS looking for when they call the toJSON()?