0

I'm getting a jshint error when I run grunt from the command line.

    Running "useminPrepare:html" (useminPrepare) task
    Going through public/index.html to update the config
    Looking for build script HTML comment blocks
    Warning: An error occurred while processing a template (Cannot read property 'options' of undefined). Use --force to continue.

    Aborted due to warnings.

In my gruntfile I have:

useminPrepare: {
  html: '<%= yeoman.app %>/index.html',
  options: {
    dest: '<%= yeoman.dist %>'
  }
},

And yeoman.dist is defined in grunt.initConfig:

yeoman: {
  // configurable paths
  app: require('./bower.json').appPath || 'public',
  dist: 'dist'
},

Why am I getting the Cannot read property 'options' of undefined error?

Connor Leech
  • 18,052
  • 30
  • 105
  • 150

1 Answers1

4

I just had the same problem. I had another task configured wrong in the gruntfile. I reused a task from another project that didn't have the object defined.

From another project I had:

<%= yeoman.dist %>

which was not defined in this project.

I found it by running grunt with --debug --verbose --force to see what else broke. The task that breaks likely has the mistake.

khornberg
  • 386
  • 3
  • 11