get openid fail Error: cloud.callFunction:fail Error: errCode: -504002 functions execute fail | errMsg: ReferenceError: wx is not defined at Object.<anonymous> (:12168/var/user/index.js:3) at Module._compile (:12168/appservice/internal/modules/cjs/loader.js:1158) at Object.Module._extensions..js (:12168/appservice/internal/modules/cjs/loader.js:1178) at Module.load (:12168/appservice/internal/modules/cjs/loader.js:1002) at Function.Module._load (:12168/appservice/internal/modules/cjs/loader.js:901) at Module.require (:12168/appservice/internal/modules/cjs/loader.js:1044) at require (:12168/appservice/internal/modules/cjs/helpers.js:77) at Object.module.exports.load (:12168/var/runtime/node12/UserFunction.js:26) at Runtime.handleOnce (:12168/var/runtime/node12/Runtime.engine.js:99) at Timeout._onTimeout (:12168/var/runtime/node12/Runtime.engine.js:56) (callId: 1659562043691-0.015394991480191855) (trace: 5:27:23 start->5:27:23 app show->5:27:24 system error (Error: errCode: -504002 functions execute fail | errMsg: ReferenceError: wx is not defined at Object.<anonymous> (:12168/var/user/index.js:3) at Module._compile (:12168/appservice/internal/modules/cjs/loader.js:1158) at Object.Module._extensions..js (:12168/appservice/internal/modules/cjs/loader.js:1178) at Module.load (:12168/appservice/internal/modules/cjs/loader.js:1002) at Function.Module._load (:12168/appservice/internal/modules/cjs/loader.js:901) at Module.require (:12168/appservice/internal/modules/cjs/loader.js:1044) at require (:12168/appservice/internal/modules/cjs/helpers.js:77) at Object.module.exports.load (:12168/var/runtime/node12/UserFunction.js:26) at Runtime.handleOnce (:12168/var/runtime/node12/Runtime.engine.js:99) at Timeout._onTimeout (:12168/var/runtime/node12/Runtime.engine.js:56)), abort) at S (WASubContext.js?t=wechat&s=1659560544268&v=2.24.1:2) at WASubContext.js?t=wechat&s=1659560544268&v=2.24.1:2 at WASubContext.js?t=wechat&s=1659560544268&v=2.24.1:2 at n (WASubContext.js?t=wechat&s=1659560544268&v=2.24.1:2) 突然间出现这个问题,云函数不能使用了,是什么原因呢?
subscribeMessage.send errCode: -504002报错?[图片]Error: cloud.callFunction:fail Error: errCode: -504002 functions execute fail | errMsg: TypeError: Do not know how to serialize a BigInt 调用订阅消息后测试消息可以发送成功,但是返回值报错Do not know how to serialize a BigInt,无法判断是否发送成功。 2022-05-01 解决方法:云函数的返回值不要返回result,直接返回result.errCode,就不会报错。原因是直接返回result被序列化导致报错(其实就是bug),所以返回result.errCode足以用于判断!
2022-08-04