question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Do not know how to serialize a BigInt"

See original GitHub issue

For reference, this was my initial issue at iobroker.zigbee Error occurred at least with converter version 14.0.446 which was used in iobroker.zigbee at this time.

Hi, with todays version from GitHub, I get this error every few (aprox 5 minutes) minutes and the adapter restarts:

2022-03-10 10:05:09.691 | error | instance system.adapter.zigbee.0 terminated with code 6 (UNCAUGHT_EXCEPTION)
-- | -- | --
zigbee.0 | 2022-03-10 10:05:09.153 | warn | Terminated (UNCAUGHT_EXCEPTION): Without reason
zigbee.0 | 2022-03-10 10:05:09.153 | info | terminating
zigbee.0 | 2022-03-10 10:05:08.711 | info | Zigbee: disabling joining new devices.
zigbee.0 | 2022-03-10 10:05:08.653 | info | cleaned everything up...
zigbee.0 | 2022-03-10 10:05:08.652 | error | Do not know how to serialize a BigInt
zigbee.0 | 2022-03-10 10:05:08.652 | error | TypeError: Do not know how to serialize a BigInt at JSON.stringify (<anonymous>) at buffer2DataObject (/opt/iobroker/node_modules/zigbee-herdsman-converters/lib/xiaomi.js:132:97) at /opt/iobroker/node_modules/zigbee-herdsman-converters/lib/xiaomi.js:282:39 at Array.forEach (<anonymous>) at Object.numericAttributes2Payload (/opt/iobroker/node_modules/zigbee-herdsman-converters/lib/xiaomi.js:140:32) at Object.convert (/opt/iobroker/node_modules/zigbee-herdsman-converters/converters/fromZigbee.js:5299:36) at /opt/iobroker/node_modules/iobroker.zigbee/main.js:463:43 at Immediate.<anonymous> (/opt/iobroker/node_modules/iobroker.zigbee/lib/statescontroller.js:175:25) at processImmediate (internal/timers.js:466:21)
zigbee.0 | 2022-03-10 10:05:08.651 | error | uncaught exception: Do not know how to serialize a BigInt

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
McGiverGimcommented, Mar 14, 2022

Thanks! This log shows what I need. I will try to study it and fix as soon as possible.

0reactions
McGiverGimcommented, Mar 14, 2022

It seems that is working as the specification says https://tc39.es/proposal-bigint/#sec-serializejsonproperty

It seems that JSON is used among different systems so they can’t add compatibility for any type of data. We must do it in our own. So applied a code similar to the one you linked.

Read more comments on GitHub >

github_iconTop Results From Across the Web

JSON.stringify() doesn't know how to serialize a BigInt #30
@ADTC answer will only work with pure javascript. With typescript I get the error: TS2339: Property 'toJSON' does not exist on type 'BigInt'....
Read more >
"TypeError: Do not know how to serialize a BigInt" - General
Hi NR folks! I'm facing a strange sporadic error from the file in node. Sometimes this happens a few times a day and...
Read more >
JSON stringify and PostgreSQL bigint compliance
Show activity on this post. I am trying to add BigInt support within my library, and ran into an issue with JSON. stringify...
Read more >
bigint - # - json - DEV Community ‍ ‍
It should be noted that how you choose to serialize your BigInts affects how you deserialize your BigInts. Generally, I serialize them by...
Read more >
Error: Do not know how to serialize a BigInt : r/MinSwap - Reddit
I getting this error when i try do stake my LPs on ADA-MIN pair:Do not know how to serialize a BigInt. Someona know...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found