收藏
回答

使用消息订阅模板,发送消息后,有报错

框架类型 问题类型 终端类型 AppID 环境ID 基础库版本
小程序 Bug 工具 wx-xxxxxxxxxx cloud1-xxxxxxxxxx 1.05.2201240

使用的数据如下:

 data:{
        'thing7':{'value':event.name},
        'thing8':{'value':event.zj_staff},
        'thing6':{'value':event.visit_reason},
        'phrase2':{'value':event.audit},
        'thing3':{'value':event.other},
      },
#上面的值,都是字符串,没有数字,报错Do not know how to serialize a BigInt\n at JSON.stringify

用了两个不同模板,其中一个模板ID为,_LXTR-Y-XUDAO1bnz-h4DV5LkDvoNrFk3aqPSEPwai0。

报错相同信息如下:

"errorCode":1,"errorMessage":"user code exception caught","stackTrace":
"TypeError: Do not know how to serialize a BigInt\n at JSON.stringify 
(\u003canonymous\u003e)\n at callback (/var/runtime/node12/CallbackContext.js:31:23)\n 
at /var/runtime/node12/CallbackContext.js:81:16\n at /var/runtime/node12/Runtime.engine.js:237:13\n 
at processTicksAndRejections (internal/process/task_queues.js:97:5)","statusCode":430}


最后一次编辑于  2022-03-15
回答关注问题邀请回答
收藏

4 个回答

  • 邓坤力
    邓坤力
    2022-03-15

    是在开发者工具本地调试的时候出现吗?在线上会出现吗?

    贴下云函数的代码?


    2022-03-15
    有用
    回复 4
    • 福
      2022-03-15
      2022-03-15
      回复
    • 福
      2022-03-15
      微信开发者工具中,调试订阅功能发现的。
      2022-03-15
      回复
    • 福
      2022-03-16
      您好,这个问题有啥进展么?
      2022-03-16
      回复
    • chang jiang
      chang jiang
      2023-07-03
      请问有什么进展么?
      2023-07-03
      回复
  • chang jiang
    chang jiang
    2023-07-03

    我也遇到类似问题, 求解

    {"errorCode":1,"errorMessage":"user code exception caught","stackTrace":"TypeError: Converting circular structure to JSON\n --\u003e starting at object with constructor 'ClientRequest'\n | property 'socket' -\u003e object with constructor 'TLSSocket'\n --- property '_httpMessage' closes the circle\n at JSON.stringify (\u003canonymous\u003e)\n at callback (/var/runtime/node12/CallbackContext.js:31:23)\n at /var/runtime/node12/CallbackContext.js:81:16\n at /var/runtime/node12/Runtime.engine.js:237:13\n at processTicksAndRejections (internal/process/task_queues.js:97:5)","statusCode":430}

    2023-07-03
    有用 1
    回复
  • 爽歪歪
    爽歪歪
    2022-09-22

    求解

    2022-09-22
    有用
    回复
  • .
    .
    2022-03-15

    大哥 我也遇到了 是新Bug嘛?百度了一天了,沒有找到解決方法

    2022-03-15
    有用
    回复 8
    • 福
      2022-03-15
      之前也没遇到过,估计是腾讯后台搞出来的bug,但是消息可以成功。我选择忽略这个bug,自己判断下。
       if(err.errCode==-404011){
            msg='消息发送成功';
          //todo

      }
      2022-03-15
      回复
    • .
      .
      发表于小程序端
      2022-03-15回复

      好吧,我之前也没遇到过,不知道是不是因为装了什么插件导致的

      2022-03-15
      回复
    • 福
      2022-03-15
      -504002 functions execute fail | errMsg: TypeError: Do not know how to serialize a BigInt

          at JSON.stringify (<anonymous>)

      -504002也得判断下。
      2022-03-15
      回复
    • .
      .
      2022-03-15回复
      好的谢谢大哥,后面如有什么更好的解决办法,过来@我一下,好人一生平安。
      2022-03-15
      回复
    • .
      .
      2022-03-15回复
      解决了 是返回值result的问题,将返回值遍历一下看看,errCode是0代表成功,想要不报错就只能返回result.errCode,不要返回result就可以了。
          
      Object.keys(result).forEach(function(key) {
       console.log(key,result[key]);
          })
       console.log(typeof result.errCode);
       console.log(typeof result.errMsg);
      console.log(JSON.stringify(result.errCode));
      console.log(JSON.stringify(result.errMsg));
      return result.errCode
      2022-03-15
      3
      回复
    查看更多(3)
登录 后发表内容