Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ngtemplates task Warning: Object.keys called on non-object #56

Closed
amayvs opened this issue Oct 22, 2013 · 5 comments
Closed

ngtemplates task Warning: Object.keys called on non-object #56

amayvs opened this issue Oct 22, 2013 · 5 comments

Comments

@amayvs
Copy link

amayvs commented Oct 22, 2013

Trying to run grunt build on a Yeoman scaffolded app with grunt-angular-templates as one of the tasks, generates the following errors:

>> Tasks directory "grunt-angular-templates" not found.

Also gives the following error:

Running "ngtemplates:TestApp" (ngtemplates) task
Warning: Object.keys called on non-object Use --force to continue.

Isolated run command: grunt ngtemplates:TestApp

Link to TestApp below:
Github repo

I'm not sure what is causing these errors.

@ericclemmons
Copy link
Owner

1st off, great issue :) Well doc'd, example code, the works!

I think I know the cause of this, and should have it patched shortly.

Thanks!

@ericclemmons
Copy link
Owner

1st, because you are using require('load-grunt-tasks')(grunt);, you won't need the grunt.loadTasks('grunt-angular-templates'); instruction on https://github.com/amayvs/TestApp/blob/master/Gruntfile.js#L368.

2nd, I found the root cause and am patching now. Thanks!

@ericclemmons
Copy link
Owner

BTW, here's the output of grunt ngtemplates now:

angular.module('TestApp').run(['$templateCache', function($templateCache) {

  $templateCache.put('views/main.html',
    "<div class=\"hero-unit\">\n" +
    "  <h1>'Allo, 'Allo!</h1>\n" +
    "  <p>You now have</p>\n" +
    "  <ul>\n" +
    "      <li ng-repeat=\"thing in awesomeThings\">{{thing}}</li>\n" +
    "  </ul>\n" +
    "  <p>installed.</p>\n" +
    "  <h3>Enjoy coding! - Yeoman</h3>\n" +
    "</div>\n"
  );

}]);

@ericclemmons
Copy link
Owner

Also, you're referencing htmlmin.app which doesn't exist. For now, I'd leave off the htmlmin part until you're ready to optimize your app.

https://github.com/amayvs/TestApp/blob/master/Gruntfile.js#L224
https://github.com/amayvs/TestApp/blob/master/Gruntfile.js#L228

@amayvs
Copy link
Author

amayvs commented Oct 23, 2013

1st off, Thanks for fixing this so quickly. Appreciate it.

2nd, my bad, htmlmin.app was copied over from another app of mine.

Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants