收藏
回答

小程序云开发发送消息出现serialize a BigInt type error?

            const noticeResult = await cloud.openapi.subscribeMessage.send({

                touser: dateQueueDetail.createOpenId,

                page: 'pages/member/sendmessage',

                data: {

                    thing2: {

                        value: 'name'

                    },

                    character_string7: {

                        value: 2

                    },

                    thing5: {

                        value: 'notice'

                    }

                },

                templateId: 'D066cmScDbIyMX2ty5Upf8-p2fu8iVuyAQUqQCr15'

            })

            console.log('noticeResult:', noticeResult);

打印输出时出现:TypeError: Do not know how to serialize a BigInt

at JSON.stringify (<anonymous>)

at /data/scf/frame/WrapLog.js:38:107

at Array.map (<anonymous>)

at commonLog (/data/scf/frame/WrapLog.js:38:45)

at Object.log (/data/scf/frame/WrapLog.js:51:7)

at exports.main (/var/user/index.js:138:21)

at processTicksAndRejections (internal/process/task_queues.js:97:5)



回答关注问题邀请回答
收藏

1 个回答

  • 北望沣渭
    北望沣渭
    01-17

    看着像是 noticeResult 类型是个BigInt,可以试试模版字符串打印方式:

    console.log('noticeResult', `${noticeResult}`);
    
    01-17
    有用
    回复
登录 后发表内容