yuhespace
yuhespace
  • 发布:2023-01-27 11:33
  • 更新:2023-02-11 13:25
  • 阅读:683

本地云函数没有问题,连接云端函数就报错

分类:uniCloud

连接本地云函数的时候运行正常,在连接云端云函数的时候就会报错
Cannot read property 'errCode' of null
代码里面也没有errCode
请问问题出在哪里

视频地址:https://drive.google.com/file/d/1rVmY0gUUO06sUwZeJGT1oBR5lwtA6RTz/view?usp=share_link

2023-01-27 11:33 负责人:无 分享
已邀请:

最佳回复

DCloud

DCloud

HBuilderX 3.7.1.20230210-alpha 已修复。

DCloud_uniCloud_WYQ

DCloud_uniCloud_WYQ

云函数云端日志贴一下

  • yuhespace (作者)

    它能修改数据库,云函数执行是成功的,但是它回调的时候报错,我想用个uni.ShowModal来提示下修改成功,就在这个地方showModal不走了,视频里面的也是能修改数据库,但是之后提示框弹不出来

    2023-01-28 15:42

yuhespace

yuhespace (作者)

uniCloud云对象代码  
updateLocation:async function(location){  
    const db = uniCloud.database()  
    const res = await db.collection('location').where({_id:location._id}).update({linkMan:location.linkMan,mobile:location.mobile,region:location.region,address:location.address})  
},  

const location = uniCloud.importObject('location')  
location.updateLocation(addData).then(e=>{  
    // console.log(e);  
    // // this.addressEdit = false  
    // // this.getLocation()  
    // uni.showModal({  
    //  title: '修改成功',  
    //  content: '修改成功',  
    //  showCancel: false,  
    //  cancelText: '取消',  
    //  confirmText: '确定',  
    //  success: res => {  
    //      if(res.confirm){  
    //          this.addressEdit = false  
    //          this.getLocation()  
    //      }  
    //  },  
    // });  

}).catch(e=>{  
    console.log("错误"+e);  
})  
.finally(()=>{  
    this.addressEdit = false  
    this.getLocation()  
})  

就这段代码,本地调试会出模态框,放上云端模态框就出不来,catch会接收一个错误:
【错误TypeError: Cannot read property 'errCode' of null】

DCloud_uniCloud_WYQ

DCloud_uniCloud_WYQ

云对象返回一个空对象试试,这个问题后续修复下

要回复问题请先登录注册