这种如何解决呢? Error: cloud.callFunction:fail Error: errCode: -504002 functions execute fail | errMsg: Runtime.ImportModuleError: Error: Cannot find module 'wx-server-sdk' Require stack: - /var/user/index.js - /var/runtime/node16/UserFunction.js - /var/runtime/node16/Runtime.engine.js - /var/runtime/node16/bootstrap.js at Object.module.exports.load (/var/runtime/node16/UserFunction.js:34:13) at Runtime.handleOnce (/var/runtime/node16/Runtime.engine.js:85:38) at Timeout._onTimeout (/var/runtime/node16/Runtime.engine.js:54:12) at listOnTimeout (node:internal/timers:557:17) at processTimers (node:internal/timers:500:7) (callId: 1715271882467-0.7034750134270631) (trace: 0:24:42 start->0:24:43 system error (Error: errCode: -504002 functions execute fail | errMsg: Runtime.ImportModuleError: Error: Cannot find module 'wx-server-sdk' Require stack: - /var/user/index.js - /var/runtime/node16/UserFunction.js - /var/runtime/node16/Runtime.engine.js - /var/runtime/node16/bootstrap.js at Object.module.exports.load (/var/runtime/node16/UserFunction.js:34:13) at Runtime.handleOnce (/var/runtime/node16/Runtime.engine.js:85:38) at Timeout._onTimeout (/var/runtime/node16/Runtime.engine.js:54:12) at listOnTimeout (node:internal/timers:557:17) at processTimers (node:internal/timers:500:7)), abort) at R (<anonymous>:1:245532) at <anonymous>:1:279958(env: Windows,mp,1.06.2402040; lib: 3.4.3)
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足以用于判断!
05-10