Do not know how to serialize a BigInt at JSON.stringify

Hey quick question. Ive been trying many different things but i am still getting this error:
TypeError: Do not know how to serialize a BigInt at JSON.stringify (<anonymous>)
TypeError: Do not know how to serialize a BigInt at JSON.stringify (<anonymous>)
im trying to convert PermissionsResolvable to PermissionsBitField wondering if anyone has ever gotten this issue and knows how to fix it structures/Command.js : https://sourceb.in/9Xe6IyRuZI botClient.js : https://sourceb.in/HStj89SSX6 full error message : https://sourceb.in/MFgbXQV14O
SourceBin
structures/Command.js
Instantly share your code with the world.
SourceBin
BotClient.js patchinteractions
Instantly share your code with the world.
SourceBin
full error
Instantly share your code with the world.
12 Replies
d.js toolkit
d.js toolkit3mo 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!
neon
neonOP3mo ago
node ver v20.17.0 npm list ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] └── [email protected]
monbrey
monbrey3mo ago
This is coming from trying to deploy a bigints, just call toString on them
neon
neonOP3mo ago
i have
No description
monbrey
monbrey3mo ago
where?
neon
neonOP3mo ago
SourceBin
BotClient.js patchinteractions
Instantly share your code with the world.
monbrey
monbrey3mo ago
ahh i see not sure why that would happen
neon
neonOP3mo ago
i usually dont use REST.put but i dont wanna keep deleting and resetting my app commands usually i just map my commands the same way as i put in the code i sent and set them using await this.application.commands.set(commandsToRegister); and that works but for some reason it doesnt with rest this is my client btw oh well thanks anyways ill figure smth out its showing fine when logging it too
{
name: 'test',
description: 'Test command',
type: 1,
options: [],
default_member_permissions: '8'
}
{
name: 'test',
description: 'Test command',
type: 1,
options: [],
default_member_permissions: '8'
}
Welp i figured it out, i had to push my mapped commands to a new map instead of an array then rest.put the Map
monbrey
monbrey3mo ago
That is very odd
neon
neonOP3mo ago
they're not registering now tho lmao but no errors :waitWhat:
monbrey
monbrey3mo ago
well I mean, I dont think it supports a Map as a data type so Im surprised it does anything
neon
neonOP3mo ago
welp a little 180 lines of code later and i can now set my slash commands in 2 ways lol
Want results from more Discord servers?
Add your server