云函数(定时器)调用cloud.DYNAMIC_CURRENT_ENV错误?
在__定时器__云函数中用以下代码进环境的环境初始化__会报错。__
而在__非定时器__云函数中,则正常。
在package.json中"wx-server-sdk": “last”
// 定时器函数初始化
cloud.init({
env: cloud.DYNAMIC_CURRENT_ENV
});
// 报错信息
{ Error: errCode: -501001 resource system error | errMsg: envname field not exsit in url;
at new CloudSDKError (/var/user/node_modules/wx-server-sdk/index.js:6398:28)
at Object.returnAsCloudSDKError (/var/user/node_modules/wx-server-sdk/index.js:6450:16)
at Object.checkError (/var/user/node_modules/wx-server-sdk/index.js:1680:23)
at Query.<anonymous> (/var/user/node_modules/wx-server-sdk/index.js:1841:41)
at step (/var/user/node_modules/tslib/tslib.js:136:27)
at Object.next (/var/user/node_modules/tslib/tslib.js:117:57)
at fulfilled (/var/user/node_modules/tslib/tslib.js:107:62)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7) errCode: -501001, errMsg: 'envname field not exsit in url; ' }