I am encountering an error during a travis-ci build for grunt-contrib-imagemin task...
Warning: Running "imagemin:dist" (imagemin) task
Fatal error: Cannot read property 'contents' of undefined
The grunt build works successfully on my local machine, however it fails when executed via travis-ci
Gruntfile.js
imagemin: {
dist: {
files: [{
expand: true,
cwd: '<%= yeoman.app %>/images',
src: '{,*/}*.{png,jpg,jpeg,gif}',
dest: '<%= yeoman.dist %>/images'
}]
}
},
Local Grunt Build (output)
Running "imagemin:dist" (imagemin) task
Minified 9 images (saved 77.32 kB)
Done, without errors.
Execution Time (2016-01-13 17:04:49 UTC)
imagemin:dist 1.6s 100%
Total 1.6s
Travis CI grunt build (output)
Warning: Running "imagemin:dist" (imagemin) task
Fatal error: Cannot read property 'contents' of undefined
Execution Time (2016-01-13 17:00:32 UTC)
loading tasks 9ms 2%
imagemin:dist 441ms 98%
Total 450ms Use --force to continue.
Aborted due to warnings.
I have tried to determine if there is a syntax issue in how I am declaring src in the task... however, that does not appear to be the case... as I can successfully complete the build locally without error using a few different syntax styles, including the example provided by Grunt for grunt-contrib-imagemin
Ref: https://github.com/gruntjs/grunt-contrib-imagemin
dynamic: { // Another target
files: [{
expand: true, // Enable dynamic expansion
cwd: 'src/', // Src matches are relative to this path
src: ['**/*.{png,jpg,gif}'], // Actual patterns to match
dest: 'dist/' // Destination path prefix
}]
Any thoughts or suggestions?