question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Lodash no longer works as a dependency, Underscore is required.

See original GitHub issue
TypeError: _.contains is not a function

Lodash does not have a .contains() function. I’ve searched through the code. Underscore does, however Lodash, if it had one, has removed it. As of right now, installing Restangular today will only work with Underscore.js

Docs should be updated, unless you want to go the route of adding support for the new functions in lodash.js

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:15 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
YassineFadhlaouicommented, Mar 4, 2016

you can solve this issue by adding this script after including lodash :

<script>
     _.contains = _.includes;
    </script>

or you can browse the restangular.js file and change _.contains by _.includes

0reactions
prestoncommented, Feb 10, 2016

I wouldn’t be a good choice, but there are a ton of existing forks. @elnygren / @R-Kurbatovvakoms / @nfntynl any takers?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Lodash in 2022: necessary or obsolete? - Nico Zerpa
And now, the question is, are Lodash and Underscore still necessary? Or Am I adding unnecessary bloat into my project?
Read more >
Solved: After updating AEM 6.5.10 underscore dependency is...
We have underscore as a dependency for out clientlibs. This was working with 6.5.5 but after 6.5.10 its not working. I see one...
Read more >
Does Lodash bundle/include Underscore? - Stack Overflow
You correctly inferred that Lodash does not depend on Underscore, at least not in production. Rather, it is a fork of Underscore that...
Read more >
eslint-plugin-you-dont-need-lodash-underscore - npm - Snyk
An important project maintenance signal to consider for eslint-plugin-you-dont-need-lodash-underscore is that it hasn't seen any new versions released to npm in ...
Read more >
The Correct Way to Import Lodash Libraries: A Benchmark
Importing Lodash libraries doesn't need to be daunting. Get insights into the top three ways to import Lodash functions.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found