Node.js version: 8.4.0
Botkit version: 0.5.5
Unsure what's going on during this event
```js from pageid:
{ object: 'page',
entry:
[ { id: '
time: 1510076342376,
messaging: [Array] } ] }
at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
Which leads to the length of undefined
```js
TypeError: Cannot read property 'length' of undefined
at Object.<anonymous> (/app/node_modules/botkit/lib/Facebook.js:19:54)
at Object.Facebookbot.facebook_botkit.handleWebhookPayload (/app/node_modules/botkit/lib/Facebook.js:336:41)
at /app/components/routes/incoming_webhooks.js:24:22
at Object.Botkit.botkit.trigger (/app/node_modules/botkit/lib/CoreBot.js:1047:49)
at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
at Function.process_params (/app/node_modules/express/lib/router/index.js:335:12)
I was previously using Botkit 0.5, and read in another issue that was resolved to upgrade to 0.5.1 which would resolve the issue, however upgrading to later versions still didn't do the trick.
Would appreciate any help on this. Thanks in advance!
@kniteshift This doesn't occur for me in v0.6.6 but the solution in previous versions was to stop listening on events standby and messaging_handovers. Must you listen for these events?

@urbanslug messaging_handovers and standby is not checked on my end.
@kniteshift can you share what is?
@peterswimm

Upon investigation, it looks like when I setup a referral link on m.me/
@kniteshift So this is okay to close, right?
@urbanslug I am still seeing the issue, and the only reproducible element is that referrals is a cause of the issue.
@kniteshift Well I could be wrong but if your referral link really has the backslash before the query string (m.me/?ref=) as is in your example that could be it.
@urbanslug sorry, I meant to say m.me/<page-id>?ref= is a case that shows the error.
Following the convention provided here: https://developers.facebook.com/docs/messenger-platform/discovery/m-me-links
@kniteshift Hey, I am also facing this issue in 0.6.6 I am looking for a fix or a workaround. Will let you know how it goes.
Sorry, in my case I was using facebook_postback instead of facebook_referral to listen for referral links. Are you using the facebook_referral event?
https://github.com/howdyai/botkit/blob/master/docs/readme-facebook.md#facebook-specific-events
@urbanslug yes we are, we have set a console log event to track each referral to the time being.
@kniteshift I suggest you try v0.6.6 to see if your problem persists. The release was described as "fix for facebook and cisco".
@urbanslug I have been a bit hesitant to switch over because I haven't gone through the documentation regarding Message Pipeline. So I'm not sure if there will be any breaking changes for FB.
@kniteshift There should be no breaking changes (after the above mentioned fix)
@peterswimm I actually upgraded to v0.6.6 but the bot did not respond, possibly because I did not apply any changes required for message pipeline and etc.,. Could you share/provide documentation for the changes needed if upgrading from 0.5?
Check out:
https://github.com/howdyai/botkit/blob/master/docs/howto/upgrade_05to06.md
If any new issues arise from this, go ahead and create a new issue!
Have had similar issue, not the same though.
Unsubscribing to two events, namely: messaging_handovers and messaging_policy_enforcements did the job.
Most helpful comment
@peterswimm

Upon investigation, it looks like when I setup a referral link on m.me/?ref= the error seems to trigger.