云开发调用云函数出错
已安装node.js 8.9.0 并安装wx-server-sdk,已创建云函数并上传云平台,访问云函数时报错
WACloud.js:1 Uncaught (in promise) Error: errCode: -404011 cloud function execution error | errMsg: cloud.callFunction:fail cloud function service error code -501005, error message Environment not found; at cloud.callFunction api;
调用代码:
onLoad(){
wx.cloud.init({ env: ‘text’ })
wx.cloud.callFunction({
name:‘add’,
data:{
a:12,
b:19
}
}).then(console.log)
}
10 回复