PassTheMayo / minecraft-server-util

A Node.js library for Minecraft servers that can retrieve status, query, RCON, and send Votifier votes.
https://passthemayo.gitbook.io/minecraft-server-util/
MIT License
141 stars 24 forks source link

Error "Do not know how to serialize a BigInt" #40

Closed MatsG23 closed 3 years ago

MatsG23 commented 3 years ago

Hello!

When I try getting the status of a Bedrock server it always fails with the error "Do not know how to serialize a BigInt".

I'm awaiting the async function and it works perfectly for the Java minecraft server but not for Bedrock. The server is running on PaperMC and the Bedrock server is powered by GeyserMC (a proxy to make a Bedrock server like the Java server). I can connect to the Bedrock server on the phone so I can verify it should work.

Best Regards Mats

Synthetic-Dev commented 3 years ago

Please provide an example of your code, does it error on the request line (status/query) or does it error on a line within your .then statement? This is probably the most likely cause of your error. image

PassTheMayo commented 3 years ago

Synthetic-Dev is right here. You are trying to use JSON.stringify() on the response object which cannot work. The response object contains a BigInt value which is not serializable. If you can provide your code, we can help you solve this.