Botkit: TypeError: Cannot read property 'length' of undefined

Created on 28 Feb 2017  路  4Comments  路  Source: howdyai/botkit

can please help me to fix this error

api_1 | /usr/src/app/node_modules/botkit/lib/CoreBot.js:441
api_1 | if (attachments.length) {
api_1 | ^
api_1 |
api_1 | TypeError: Cannot read property 'length' of undefined
api_1 | at Conversation.replaceAttachmentTokens (/usr/src/app/node_modules/botkit/lib/CoreBot.js:441:28)
api_1 | at Conversation.replaceAttachmentTokens (/usr/src/app/node_modules/botkit/lib/CoreBot.js:456:47)
api_1 | at Conversation.replaceAttachmentTokens (/usr/src/app/node_modules/botkit/lib/CoreBot.js:447:56)
api_1 | at Conversation.cloneMessage (/usr/src/app/node_modules/botkit/lib/CoreBot.js:540:44)
api_1 | at Conversation.tick (/usr/src/app/node_modules/botkit/lib/CoreBot.js:622:53)
api_1 | at Task.tick (/usr/src/app/node_modules/botkit/lib/CoreBot.js:825:36)
api_1 | at Object.Botkit.botkit.tick (/usr/src/app/node_modules/botkit/lib/CoreBot.js:1099:29)
api_1 | at Timeout._onTimeout (/usr/src/app/node_modules/botkit/lib/CoreBot.js:1049:24)
api_1 | at ontimeout (timers.js:365:14)
api_1 | at tryOnTimeout (timers.js:237:5)

help wanted

Most helpful comment

This was fixed with this commit

Try updating to the latest botkit version, which is v0.5.1 at time of writing.

All 4 comments

Try removing your node_modules and then running a fresh npm install and run it again. I've seen this error before when botkit is missing some dependencies. It's difficult to debug without seeing your code though. Are you using an example clone from botkit or your own? Is there anyway I can take a look at it?

This was fixed with this commit

Try updating to the latest botkit version, which is v0.5.1 at time of writing.

@pkkalive still having trouble?

@peterswimm this problem is resolved. no more problems. thank you everybody for solving it

Was this page helpful?
0 / 5 - 0 ratings