Alex-Rose / fb-messenger-cli

fb-messenger-cli, console Facebook messenger
759 stars 99 forks source link

Cannot read property 'toLowerCase' of undefined while searching #193

Open pniedzwiedzinski opened 5 years ago

pniedzwiedzinski commented 5 years ago

As I used search function this error occurred:

> /search PRDev
/usr/local/lib/node_modules/fb-messenger-cli/lib/search.js:49
            return friend.name.toLowerCase().indexOf(searchString.toLowerCase()) !== -1;
                               ^

TypeError: Cannot read property 'toLowerCase' of undefined
    at filtered.friends.filter (/usr/local/lib/node_modules/fb-messenger-cli/lib/search.js:49:32)
    at Array.filter (<anonymous>)
    at Search.filterFriends (/usr/local/lib/node_modules/fb-messenger-cli/lib/search.js:48:38)
    at messenger.getFriends (/usr/local/lib/node_modules/fb-messenger-cli/lib/search.js:42:18)
    at Request.request.post [as _callback] (/usr/local/lib/node_modules/fb-messenger-cli/lib/messenger.js:528:24)
    at Request.self.callback (/usr/local/lib/node_modules/fb-messenger-cli/node_modules/request/request.js:185:22)
    at Request.emit (events.js:188:13)
    at Request.<anonymous> (/usr/local/lib/node_modules/fb-messenger-cli/node_modules/request/request.js:1161:10)
    at Request.emit (events.js:188:13)
    at Gunzip.<anonymous> (/usr/local/lib/node_modules/fb-messenger-cli/node_modules/request/request.js:1083:12)
tomoliveri commented 5 years ago

I have the same issue.

No conversations appear on the first screen, selecting any number gives the error;

Warning: Input is out of bounds

Aradora commented 5 years ago

Same here. Using Arch Linux.

vegancreampie commented 5 years ago

Same. Using OS X

petersonwagner commented 5 years ago

Same. Ubuntu 16.04

manegame commented 5 years ago

Same. MacOS 10.14.1

petersonwagner commented 5 years ago

this solution fixed for me.

olundberg commented 5 years ago

Same issue for me. Ubuntu 19.04.

Aradora commented 5 years ago

Actually I solved this issue for me(Arch Linux). You need correct version of node.js. Error occured when I used 10 but when I downgraded to 7 it worked.

mkubdev commented 5 years ago

Same on Windows 10 with Powershell, downgrading npm to 7 change nothing for me. Does it even work on Windows 10 ?

Alex-Rose commented 5 years ago

It should work we developed on Win10, perhaps you would have better luck with cmd. At some point I should have some free time to address the root cause.

Matoo125 commented 5 years ago

The same problem with windows 10 and cmd

Matoo125 commented 5 years ago

Okay I removed .kryptonite in _AppData\Roaming\npm\nodemodules\fb-messenger-cli and now it works.