discordx-ts / discordx

🤖 Create a discord bot with TypeScript and Decorators!

Home Page:https://discordx.js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[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

I want to second this issue. I have almost the same setup (with and without Dotenv) and I am getting the same error.

Please see this discord chat log for more info:
image

@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

Can confirm the workaround seems to be working. thanks @oceanroleplay