Function returned undefined, expected Promise or value

后端 未结 3 1930
萌比男神i
萌比男神i 2021-01-16 01:20

Whern i fire Simple database trigger on firebase, then it will shows Error like this : \"Function returned undefined, expected Promise or value\"

         


        
3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-16 01:53

    If you just want the error to disappear you could simply just

    return new Promise((resolve, reject) => {
        resolve("A Notification has been deleted from the database ")
    })
    

    but it would be kinda pointless to return a string here.

    If it's just for testing you could

    console.log("A Notification has been deleted from the database ")
    

    instead.

提交回复
热议问题