-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Lodash 4.0 release breaks some functions #1682
Comments
From backtrace: TypeError: _.contains is not a function TypeError: _.object is not a function |
Just noticed this myself. angular-google-maps 2.2.1 depends on lodash 4... but lodash 4 repaced _.contains w/ _.includes i think i read. |
Well crap the versioning should have been 3.X . Any suggestions on dealing with both 3 and 4 ? |
Can you maybe define the alias yourself if it doesn't exist before rest of angular-google-maps runs?
|
It seems |
So it is locked down on master and on 2.2.X , as for a solid fix to use 4.0. That will have to come later or by some other soul (PR). I am currently not using this library for work anymore and can only work on it in my spare time (which is not much with work and 5 month old). |
I can maybe take a look later (since im using other projects that use lodash 4). Will let u know if a PR happens. |
Might need a little help nmccready... Maybe one of the init/load methods I see or wasnt sure if uiGmapLodash is the definite optimal place (since i see below code does something similar... looks like if _.get isn't available for lodash2? users maybe, it creates it):
|
Here is solution:
We write it in Main.js file |
|
@armyofda12mnkeys what file and line please via github urls. |
They use lodash "Chain" methods https://github.com/lodash/lodash/blob/3.10.1/doc/README.md
https://github.com/angular-ui/angular-google-maps/blob/master/dist/angular-google-maps.js |
Yeah its here so it is in events-helper.coffee That chain can easily be removed. Using |
PR merged changed it to includes, but still the chain is not needed. |
This added to line 99 in lodash.coffee (https://github.com/angular-ui/angular-google-maps/blob/master/src/coffee/extensions/lodash.coffee) might work: but haven't really tested it (I couldn't compile the full coffeescript via grunt ... but it might be something else [wierd phantomJS underscore errors] if you can take a look):
|
using temporary solution for now. But I'm looking forward for a proper fix :D Thanks you guys for your hard works. |
This does not fix a lot of things. Many specs are broken on using lodash 4.0 . Still having a tough time figuring out a few of them. Here is the branch with progress. https://github.com/angular-ui/angular-google-maps/tree/dev/nmccready/tryingToMakeLodash4Wurk |
Anyone feel free to help work on that branch and PR to it. I can only work on it once in a while. I put too much time into it last night anyhow. |
I can take a look... |
You should be seeing errors. Pull down the code and run |
Tests that are broken:
|
#1711 resolves this |
I couldn't figure it out. Thanks for fixing @nmccready ... |
Alot of the problem was in _async.coffee and I just removed lodash from that part. |
This part angular-google-maps/src/coffee/directives/api/utils/_async.coffee Lines 152 to 155 in 9419a4c
became angular-google-maps/src/coffee/directives/api/utils/_async.coffee Lines 158 to 164 in f37e1b5
|
More patching angular-google-maps/src/coffee/extensions/lodash.coffee Lines 12 to 29 in f37e1b5
|
@nmccready correct me if I'm wrong (I've never written a line of coffee script) but as long as I can tell |
Sure, there are several ways to do a lot of things. |
@nmccready Hey sir, I am having this problem when trying to use angular-ui-map in my MEAN stack application for a course in college. From what I understand, the "aliasing" code bit should fix this problem for me? If so, I am completely unsure of where to add this line of code. I am using the current version of the MEAN.js boilerplate template for this application and have done the bower install --save. Could you please advise on where to implement the code bit to solve this problem, thanks! |
@nmccready , I am getting below for running appium command from terminal, Please provide solution for same: $ npm ls lodash npm version : 5.3.0 TypeError: _lodash2.default.toPairs is not a function |
No description provided.
The text was updated successfully, but these errors were encountered: