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

Grunt imagemin error - "Cannot read property 'contents' of undefined" #23

Open
viktorstrate opened this issue Nov 28, 2016 · 3 comments

Comments

@viktorstrate
Copy link

viktorstrate commented Nov 28, 2016

When I run grunt, it fails at imagemin:dist. I haven't modified any code in any ways.
I'm running Windows 10, with node version 6.9.1 and npm version 3.10.8.

Expected behavior

Execute the imagemin:dist without errors

Actual behavior

Returned error Fatal error: Cannot read property 'contents' of undefined

Console log

$ grunt
Running "sass:dist" (sass) task

Running "autoprefixer:files" (autoprefixer) task
>> 2 autoprefixed stylesheets created.
>> 2 sourcemaps created.

Running "cssmin:minify" (cssmin) task
>> 2 files created. 23.21 kB → 7.5 kB

Running "uglify:plugins" (uglify) task
>> 1 sourcemap created.
>> 1 file created.

Running "uglify:main" (uglify) task
>> 1 sourcemap created.
>> 1 file created.

Running "imagemin:dist" (imagemin) task
Fatal error: Cannot read property 'contents' of undefined
@mattbanks
Copy link
Owner

I haven't taken a look at this code in quite a while. I'm guessing that the packages and API's have changed. Try upgrading the package versions and see if that changes anything.

@KulaGeoff
Copy link

KulaGeoff commented Dec 14, 2016

gruntjs/grunt-contrib-imagemin#330 (comment) helped me resolve this issue. Instead of adding ^1.0.0, I added ~1.0.0 though.

@czuli
Copy link

czuli commented Oct 7, 2019

Update package.json in #27

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

4 participants