mathew-kurian / FacebookMessengerBot.js

:mailbox: Simple, light-weight Facebook Messenger Bot API for Node with ES6 support (via. Promises)
https://developers.facebook.com/docs/messenger-platform
117 stars 24 forks source link

Unhandled promise rejection on postback buttons #26

Open kahric opened 6 years ago

kahric commented 6 years ago

Hello! When I set postback buttons, everything is alright, but when the user presses one of those buttons, I get an error that crashes my express server with message:

Unhandled rejection TypeError: Cannot read property '0' of undefined
    at Bot._callee8$ (C:\Users\Belmin\Desktop\React\heroku-foodbod\node_modules\facebook-messenger-bot\dist\Bot.js:431:50)
    at tryCatch (C:\Users\Belmin\Desktop\React\heroku-foodbod\node_modules\regenerator-runtime\runtime.js:65:40)
    at Generator.invoke [as _invoke] (C:\Users\Belmin\Desktop\React\heroku-foodbod\node_modules\regenerator-runtime\runtime.js:299:22)
...
...

My code is exactly the same as the one in the postback example (this one)