使用facebook chatbot Error Issue的IBM watson对话

时间:2017-10-07 04:28:05

标签: node.js facebook chatbot

这是我面临的错误。我正在使用ibm botkit-middleware。可能是什么错误以及如何解决?

Fatal TypeError: Cannot read property 'output' of undefined
    at Object.<anonymous> (C:\Users\User\Desktop\botkit-middleware-master3\examples\multi-bot\bot-facebook.js:45:32)
    at Object.<anonymous> (C:\Users\User\Desktop\botkit-middleware-master3\examples\multi-bot\node_modules\botkit\lib\CoreBot.js:753:28)
    at Object.Botkit.botkit.trigger (C:\Users\User\Desktop\botkit-middleware-master3\examples\multi-bot\node_modules\botkit\lib\CoreBot.js:779:49)
    at C:\Users\User\Desktop\botkit-middleware-master3\examples\multi-bot\node_modules\botkit\lib\CoreBot.js:866:32
    at Object.bot.findConversation (C:\Users\User\Desktop\botkit-middleware-master3\examples\multi-bot\node_modules\botkit\lib\Facebook.js:103:13)
    at C:\Users\User\Desktop\botkit-middleware-master3\examples\multi-bot\node_modules\botkit\lib\CoreBot.js:862:21
    at next (C:\Users\User\Desktop\botkit-middleware-master3\examples\multi-bot\node_modules\ware\lib\index.js:82:27)
    at C:\Users\User\Desktop\botkit-middleware-master3\examples\multi-bot\node_modules\wrap-fn\index.js:121:18
    at C:\Users\User\Desktop\botkit-middleware-master3\examples\multi-bot\node_modules\botkit-middleware-watson\lib\middleware\index.js:121:9
    at tryCatcher (C:\Users\User\Desktop\botkit-middleware-master3\examples\multi-bot\node_modules\bluebird\js\release\util.js:16:23)
    at Promise._settlePromiseFromHandler (C:\Users\User\Desktop\botkit-middleware-master3\examples\multi-bot\node_modules\bluebird\js\release\promise.js:512:31)
    at Promise._settlePromise (C:\Users\User\Desktop\botkit-middleware-master3\examples\multi-bot\node_modules\bluebird\js\release\promise.js:569:18)
    at Promise._settlePromise0 (C:\Users\User\Desktop\botkit-middleware-master3\examples\multi-bot\node_modules\bluebird\js\release\promise.js:614:10)
    at Promise._settlePromises (C:\Users\User\Desktop\botkit-middleware-master3\examples\multi-bot\node_modules\bluebird\js\release\promise.js:693:18)
    at Promise._fulfill (C:\Users\User\Desktop\botkit-middleware-master3\examples\multi-bot\node_modules\bluebird\js\release\promise.js:638:18)
    at Promise._resolveCallback (C:\Users\User\Desktop\botkit-middleware-master3\examples\multi-bot\node_modules\bluebird\js\release\promise.js:432:57)

1 个答案:

答案 0 :(得分:0)

您需要调试代码,但可能的原因是您返回的返回响应无效,或者在读取响应之前未进行任何调用。

错误:

Fatal TypeError: Cannot read property 'output' of undefined

output是响应中返回的JSON对象。

明显的错误

  • 服务用户名/密码错误。
  • 工作区ID错误。
  • 如果您的对话服务不在美国,则未指定网址。大多数示例代码假定它在美国运行。