- 当前 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的程度,报错一天,气死人