我在微信云开发的时候,云函数已经上传了,然后点击本地测试可以返回接口,但云端测试就不行了。提示我没有安装request-promise,我明明已经安装了的啊
云函数查询数据库报错- 当前 Bug 的表现(可附上截图) Error: errCode: -404011 cloud function execution error | errMsg: cloud.callFunction:fail cloud function service error code -504002, error message Unexpected identifier; at cloud.callFunction api; - 预期表现 还预期什么表现,就是官方demo了 - 复现路径 - 提供一个最简复现 Demo const cloud = require('wx-server-sdk') cloud.init({ env: 'online-env' }) const db = cloud.database({ env: 'online-env' }) const userDB = db.collection("user") const _ = db.command exports.main = (event, context) => { try { return await db.collection('user').doc('9c4488c75cc470fd07e2083a6bae3288').get() } catch (e) { console.error(e) } } 云端报错:"errorCode":1,"errorMessage":"user code exception caught","stackTrace":"Unexpected identifier" 云端报错 const cloud = require('wx-server-sdk') cloud.init({ env: 'online-env' }) const db = cloud.database({ env: 'online-env' }) const userDB = db.collection("user") exports.main = (event, context) => { try { return await db.collection('user').doc('9c4488c75cc470fd07e2083a6bae3288').get() } catch (e) { console.error(e) } } 官方demo的程度,报错一天,气死人
2020-04-19