TypeError: Buffer.allocUnsafe is not a function
at Object.encode (DateCodec.js:52)
at encodeExt (encoder.js:136)
at encode (encoder.js:30)
at encoder.js:77
at Array.forEach (<anonymous>)
at encodeObject (encoder.js:76)
at encode (encoder.js:30)
at Array.map (<anonymous>)
at encode (encoder.js:29)
at Array.map (<anonymous>)
when a Date is passed
console:
dt
Fri Dec 25 2020 09:37:41 GMT+0100 (Central European Standard Time)
else if (nanos || seconds > 0xffffffff) is evaluated to true, afterwards
TypeError: Buffer.allocUnsafe is not a function
at Object.encode (DateCodec.js:52)
at encodeExt (encoder.js:136)
at encode (encoder.js:30)
at encoder.js:77
at Array.forEach (<anonymous>)
at encodeObject (encoder.js:76)
at encode (encoder.js:30)
at Array.map (<anonymous>)
at encode (encoder.js:29)
at Array.map (<anonymous>)
Sorry, I've made a mess with the releases and shipped a semver-major change in the latest release. I've released v4.5.0 as it was v4.2.1. All the new improvements are in v5.0.0.
when a Date is passed console:
millis: 1608885461471 seconds: 1608885461 nanos: 471000000
else if (nanos || seconds > 0xffffffff) is evaluated to true, afterwards
is thrown.
with v4.2.1 its working fine.