gyselroth / balloon-client-desktop

balloon desktop client for Windows, Mac OS X and Linux
GNU General Public License v3.0
10 stars 3 forks source link

Logger can't serialize BigInt's #228

Open pixtron opened 4 years ago

pixtron commented 4 years ago

Describe the bug

When logging an object with a BigInt Uncaught TypeError: Do not know how to serialize a BigInt is thrown.

To Reproduce

There are two known cases in sync module where BigInt's are logged:

https://github.com/gyselroth/balloon-node-sync/blob/97bd70918eeaa901d74f743dfb878fbb619068f8/lib/delta/delta.js#L423 https://github.com/gyselroth/balloon-node-sync/blob/97bd70918eeaa901d74f743dfb878fbb619068f8/lib/delta/delta.js#L445

There are

Expected behavior

Logger should serialize BigInt's to a string.

Environment

Additional context

See: davidmarkclements/fast-safe-stringify/issues/41

Uncaught TypeError: Do not know how to serialize a BigInt
    at JSON.stringify (<anonymous>)
    at JsonStringify (/Users/.../balloon-client-desktop/node_modules/fast-safe-stringify/index.js:18)
    at stringify (/Users/.../balloon-client-desktop/node_modules/fast-safe-stringify/index.js:27)