我在local端 call 雲函數調用database代碼在一開始會報錯
const cloud = require(‘wx-server-sdk’)
cloud.init()
const db = cloud.database() // 讀到這行會報錯
Error: errCode: -404011 cloud function execution error | errMsg: cloud.callFunction:fail cloud function service error code -504002, error message TypeError: this.realHandler is not a function
at EventHandler.handle (/var/runtime/node8/bootstrap.js:238:34)
at invoke (/var/runtime/node8/bootstrap.js:111:22)
at Timeout.setTimeout [as _onTimeout] (/var/runtime/node8/bootstrap.js:61:9)
at ontimeout (timers.js:475:11)
at tryOnTimeout (timers.js:310:5)
.
.
.
請問有人知道是什麼原因嗎