which is successfully returning the expected result
I’m getting the following error “TypeError: Do not know how to serialize a BigInt”
W20220901-17:55:03.993(9.5)? (STDERR) (node:10322) UnhandledPromiseRejectionWarning: TypeError: Do not know how to serialize a BigInt
W20220901-17:55:03.994(9.5)? (STDERR) at JSON.stringify (<anonymous>)
W20220901-17:55:03.994(9.5)? (STDERR) at Object.DDPCommon.stringifyDDP (packages/ddp-common/utils.js:116:15)
W20220901-17:55:03.994(9.5)? (STDERR) at Session.send (packages/ddp-server/livedata_server.js:514:34)
W20220901-17:55:03.994(9.5)? (STDERR) at packages/ddp-server/livedata_server.js:792:14
W20220901-17:55:03.994(9.5)? (STDERR) at /Users/robgordon/.meteor/packages/promise/.0.12.0.qsgjpe.bwik++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/meteor-promise/fiber_pool.js:43:40
W20220901-17:55:03.994(9.5)? (STDERR) (node:10322) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 4)
createSquarePayment
Result: {
payment: {
id: 'dm6Hgk0B5kkPyMZa366W1mC8RYJZY',
createdAt: '2022-09-02T01:57:41.815Z',
amountMoney: { amount: 100n, currency: 'AUD' },
status: 'COMPLETED',
},
}
} 200
(node:14485) UnhandledPromiseRejectionWarning: TypeError: Do not know how to serialize a BigInt
at JSON.stringify (<anonymous>)
at Object.DDPCommon.stringifyDDP (packages/ddp-common/utils.js:116:15)
at Session.send (packages/ddp-server/livedata_server.js:514:34)
at packages/ddp-server/livedata_server.js:792:14
at /Users/robgordon/.meteor/packages/promise/.0.12.0.qsgjpe.bwik++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/meteor-promise/fiber_pool.js:43:40
(Use `node --trace-warnings ...` to show where the warning was created)
(node:14485) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:14485) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
By limiting the results I returned, the error is not triggered.
A {key:value} pair within the payment object was triggering the error.
I found it by stringifying the object