4

I'm getting a weird warning when trying to use imagemin and nothing happens.

grunt imagemin:primary

Warning: Cannot call method 'replace' of undefined Used --force, continuing.
Done, but with warnings.

My task that gives me the error is as follows

  grunt.config 'imagemin'

    primary:
      options:
        optimizationLevel: 7
      expand: true
      cwd: "assets"
      src: "{img,img_two}/**/*.{jpg,jpeg,gif,png}"
      dest: "public/compiled/img"


  grunt.loadNpmTasks 'grunt-contrib-imagemin'

These don't work

src: "img/**/*.{jpg,jpeg,gif,png}"

src: "{img,img_two}/**/*.{jpg,jpeg,gif,png}"

These work

src: "img/**/*.jpg"

src: "{img,img_two}/**/*.jpg"

So it seems it doesn't like multiple extensions syntax but why, it's even how it's done in the example?

UPDATE: it seems it's just PNG that doesn't work whether I do the extension on it's own or within a group matching. I'm on Windows 8, NPM 1.4.3

https://github.com/gruntjs/grunt-contrib-imagemin/issues/219

user391986
  • 29,536
  • 39
  • 126
  • 205

1 Answers1

11

Had the same problem I fixed it by deleting the grunt-contrib-imagemin directory located inside node_modules

Then I ran "npm install grunt-contrib-imagemin" to grab the latest version.

FlashJordan
  • 173
  • 1
  • 9