matteodem / meteor-easy-search

Easy-to-use search for Meteor with Blaze Components
MIT License
437 stars 68 forks source link

Autosuggest Error: TypeError: _.get is not a function #482

Closed uberism closed 8 years ago

uberism commented 8 years ago

It seems like the lodash or underscore get is giving me errors when trying to use autosuggest. Any ideas why I am getting TypeError: _.get is not a function?

matteodem commented 8 years ago

How did you produce that error?

uberism commented 8 years ago

By using {{> EasySearch.Autosuggest index=myIndex}}

Tried this in my own project and also in the leaderboard example. In the leaderboard example I replaced EasySearch.Input with EasySearch.Autosuggest.

joeblurton commented 8 years ago

I also have this problem using {{> EasySearch.Autosuggest index=myIndex }}

talalav commented 8 years ago

Add globally _ = lodash;

steven-tib commented 8 years ago

Hi, I'm having the same error, and cannot manage to add _ = lodash; to solve it

@joeblurton and @uberism did that solve your issue ? (I'm new to meteor and JS, maybe i'm just not including this code at the right place...)

Thanks a lot for your help

joeblurton commented 8 years ago

Interesting. I had no idea what lodash was until now. I'm just quick prototyping so I've culled the feature for now and moved on, but will return to it and update when I can.

steven-tib commented 8 years ago

I actually found out, was a stupid beginner error, I've added lodash (stevezhu:lodash) package and added _ = lodash; to my client and server and it worked. Also, note that if you use lodash and underscore at the same time you might have namespace conflicts. There are a bunch of discussions about this topic on meteor forums apparently.

matteodem commented 8 years ago

Published version 2.0.10 with a changed dependency to lodash, which is not weak anymore.