框架类型 | 问题类型 | 终端类型 | AppID | 环境ID | 基础库版本 |
---|---|---|---|---|---|
小程序 | Bug | 工具 | wxe8d80836d14253da | ime | 2.8.1 |
按照云开发->多端支持指引,使用CDN[https://res.wx.qq.com/open/js/cloudbase/1.0.0/cloud.js]初始化成功。
const init = async function(){
await cloud.init({
appid: 'xxx',
env: 'xxx',
})
const db = cloud.database()
db.collection("tests").aggregate().limit(1).end().then(res=>{
console.log(res)
}).catch(err=>{
console.log(err)
})
}()
浏览器报错
Error: errCode: -1 | errMsg: collection.aggregate:fail TypeError: Cannot read property 'parse' of undefined; at collection.aggregate api;
at new t (cloud.js?0249:16)
at eval (cloud.js?0249:16)
at c (cloud.js?0249:16)
at r.eval (cloud.js?0249:16)
at eval (cloud.js?0249:16)
at Object.eval [as throw] (cloud.js?0249:16)
at s (cloud.js?0249:16)
临时解决方法,修改CND源码
h=n(57).EJSON ==========> h=JSON