[Bug]: TypeError: Do not know how to serialize a BigInt
G33RY opened this issue · comments
What happened?
I have installed the basic starter kit and I am getting an error:
The only thing I installed after is the dotenv
package.
When I remove all methods with the @slash decorator the bot starts without problem.
Reproduction
https://github.com/G33RY/starter-app
Package
discordx
Version
Stable
Relevant log output
bot >> connecting discord...
Malloybot >> commands >> global
>> adding 0 []
>> updating 0 []
>> deleting 0 []
>> skipping 0 []
TypeError: Do not know how to serialize a BigInt
at JSON.stringify (<anonymous>)
at Client.isApplicationCommandEqual (file:///Users/G33RY/Projects/Work/starter-app/node_modules/discordx/src/Client.ts:797:14)
at file:///Users/G33RY/Projects/Work/starter-app/node_modules/discordx/src/Client.ts:619:17
at Array.map (<anonymous>)
at Client.initGuildApplicationCommands (file:///Users/G33RY/Projects/Work/starter-app/node_modules/discordx/src/Client.ts:602:15)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Promise.all (index 0)
at async Promise.all (index 0)
at async Client.initApplicationCommands (file:///Users/G33RY/Projects/Work/starter-app/node_modules/discordx/src/Client.ts:555:5)
at async Client.<anonymous> (file:///Users/G33RY/Projects/Work/starter-app/src/main.ts:39:3)
[nodemon] app crashed - waiting for file changes before starting...
Code of Conduct
- I agree to follow this project's Code of Conduct
@G33RY Error occurs on version 16 of node for me, If your on that version (check using node -v) then try the next version, Node Version 17 or 18
@TeamWolfyta I tried this,
Update to 18.7.0. Updated all dependencies, clean build. and still the same error.
Hello
I have the same issue with node version 18
please read this to understand issue in depth https://dev.to/benlesh/bigint-and-json-stringify-json-parse-2m8p
and use this solution for now, https://github.com/oceanroleplay/discord.ts/blob/main/packages/discordx/examples/permission/main.ts#L9
Can confirm the workaround seems to be working. thanks @oceanroleplay
please read this to understand issue in depth https://dev.to/benlesh/bigint-and-json-stringify-json-parse-2m8p
and use this solution for now, https://github.com/oceanroleplay/discord.ts/blob/main/packages/discordx/examples/permission/main.ts#L9
Its working for me too. Thank you.