示例代码里面getOpenData提示这个错误什么意思,公共库大于2.8,openapi已经上传?
发布于 7 年前 作者 jie79 9545 次浏览 来自 官方Issues

{"errorCode":1,"errorMessage":"user code exception caught","stackTrace":"errCode: -501001 resource system error | errMsg: getOpenData:fail source.on is not a function; at getOpenData api; "}

{ action: 'getOpenData',

openData:

{ list:

[ '25_Rt-GB2xMTxJi5Hb_Z548eoBHqrtfPBCjXBy4UhJk5I7DVXxpSCBcNCzMUhM' ] },

userInfo:

{ appId: 'wx1e6acdbd04edfd2f',

openId: 'okH_90DrM3pIhNB8ennkCbNW4Gqs' } }

Error: errCode: -501001 resource system error | errMsg: getOpenData:fail source.on is not a function; at getOpenData api;

at new CloudSDKError (/var/user/node_modules/wx-server-sdk/index.js:6366:28)

at returnAsCloudSDKError (/var/user/node_modules/wx-server-sdk/index.js:6418:16)

at Object.returnAsFinalCloudSDKError (/var/user/node_modules/wx-server-sdk/index.js:6432:13)

at Cloud.<anonymous> (/var/user/node_modules/wx-server-sdk/index.js:2218:41)

at step (/var/user/node_modules/tslib/tslib.js:136:27)

at Object.throw (/var/user/node_modules/tslib/tslib.js:117:57)

at rejected (/var/user/node_modules/tslib/tslib.js:108:69)

at <anonymous>

4 回复

麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html

抱歉是 wx-server-sdk 的问题,请升级下 wx-server-sdk 到最新版(1.2.2)再试试呢?

我也有类似的问题:

WAService.js:1 Uncaught (in promise) Error: errCode: -404011 cloud function execution error | errMsg: cloud.callFunction:fail requestID 1322129a-e4e6-11e9-b3ac-525400e8849e, cloud function service error code -504002, error message errCode: -501001 resource system error | errMsg: getOpenData:fail source.on is not a function; at getOpenData api; ; at cloud.callFunction api; 

    at new u (WAService.js:1)

    at d (WAService.js:1)

    at f (WAService.js:1)

    at Function.success (WAService.js:1)

    at WAService.js:1

    at C (WAService.js:1)

    at i.<anonymous> (WAService.js:1)

    at i.emit (WAService.js:1)

    at Rs (WAService.js:1)

    at WAService.js:1

u @ WAService.js:1

d @ WAService.js:1

f @ WAService.js:1

success @ WAService.js:1

(anonymous) @ WAService.js:1

C @ WAService.js:1

(anonymous) @ WAService.js:1

i.emit @ WAService.js:1

Rs @ WAService.js:1

(anonymous) @ WAService.js:1

(anonymous) @ WAService.js:1

n @ VM106 asdebug.js:1

(anonymous) @ VM106 asdebug.js:1

t.emit @ VM106 asdebug.js:1

callback @ VM106 asdebug.js:1

(anonymous) @ VM106 asdebug.js:1

(anonymous) @ WAService.js:1

(anonymous) @ WAService.js:1

Promise.then (async)

onGetUserInfo @ cloudid.js:48

r.safeCallback @ WAService.js:1

(anonymous) @ WAService.js:1

r @ WAService.js:1

(anonymous) @ WAService.js:1

(anonymous) @ WAService.js:1

n @ VM106 asdebug.js:1

(anonymous) @ VM106 asdebug.js:1

(anonymous) @ VM106 asdebug.js:1

_ws.onmessage @ VM106 asdebug.js:1

回到顶部