klei / gulp-angular-filesort

Automatically sort AngularJS app files depending on module definitions and usage
MIT License
132 stars 46 forks source link

TypeError: Object has no method 'any' #22

Closed Guuz closed 9 years ago

Guuz commented 9 years ago

The latest version breaks:

return Object.keys(ngDeps.modules).any(function (module) {
                                     ^
TypeError: Object  has no method 'any'

The build of this module is also breaking: https://travis-ci.org/klei/gulp-angular-filesort

Trying to downgrade in our project to see if it fixes this.

jigfox commented 9 years ago

the tests on travis ci show the same error: https://travis-ci.org/klei/gulp-angular-filesort/jobs/51355096

Guuz commented 9 years ago

Yup! this could have broken many projects around the world... :-/ Not so sure if the npm syntax with the tilde is really great. In theory it is better but people accidentally release broken code. We had "~1.0.4" and that upgraded to "1.1.0" which is broken...

joakimbeng commented 9 years ago

@Guuz if you've used the tilde it shouldn't upgrade to 1.1.0, see for instance http://stackoverflow.com/questions/22343224/difference-between-tilde-and-caret-in-package-json

This is a typo, and did work before because ng-dependencies had sugar as a dependency. The method should be Array.prototype.some.

A fix is on its way!

Guuz commented 9 years ago

Thanks for the quick fix! And I made a mistake and said tidle when I ment '^'. This is the NPM default but it's bitten me a few times now... Like this. An dependency changes and breaks but it is auto updated and hard to trace down. Any suggestions?