grunt-contrib-uglify: Cannot read property 'min' of undefined

With new grunt I have problems with minification

Loading "uglify.js" tasks...OK
+ uglify
Loading "Gruntfile.js" tasks...OK
+ build, default, test, urchin

Running tasks: uglify

Running "uglify" task

Running "uglify:beautify" (uglify) task
Verifying property uglify.beautify exists in config...OK
Files: plugin/beautify.js -> beautify.js
Minifying with UglifyJS...Reading plugin/beautify.js...OK
Warning: Uglification failed. Used --force, continuing.
Warning: Cannot read property 'min' of undefined Used --force, continuing.

``

grunt-cli v0.1.6
grunt v0.4.1
grunt-contrib-uglify v0.2.0

About this issue

  • Original URL
  • State: closed
  • Created 11 years ago
  • Comments: 18 (4 by maintainers)

Most upvoted comments

To anyone getting here from google: if you go to node_modules\grunt-contrib-uglify\node_modules\uglify-js\lib\parse.js line 196, and add a “console.log(line);”, you’ll be able to see what line of your javascript is incorrect. The offending file is the last one that grunt reports before the error message.

Try reinstalling your dependencies (remove node_modules and reinstall), OutputStream comes from UglifyJS and if that’s not accessible then there may be a problem there.

Failing that, clone this repo and run the tests (grunt test). They run fine on my OSX machine.

Closing this issue because it’s a bunch of everyone’s issues with similar symptoms. If your issue persists, open a new issue so we can track it better.