gruntjs / grunt-contrib-sass

Compile Sass to CSS.
http://gruntjs.com/
MIT License
848 stars 141 forks source link

warnings cause abort on Sass < 3.4 #176

Closed ThisGuyCodes closed 9 years ago

ThisGuyCodes commented 9 years ago

Sourcemaps were turned on by default in 3.4 and a flag was added to not do that. But specifying this flag when on sass < 3.4 (as is the default in OSX) causes warnings which by default causes the operation to cancel.

    Warning: OptionParser::NeedlessArgument: needless argument: --sourcemap=none
      Use --trace for backtrace.
    OptionParser::NeedlessArgument: needless argument: --sourcemap=none
      Use --trace for backtrace.
    OptionParser::NeedlessArgument: needless argument: --sourcemap=none
      Use --trace for backtrace.
    OptionParser::NeedlessArgument: needless argument: --sourcemap=none
      Use --trace for backtrace. Use --force to continue.

        Aborted due to warnings.

I'm not sure if this is this projects responsibility, but it'd be awesome if when using sass < 3.4 this didn't happen. Or at least a more descriptive message for the cause was displayed, something akin to:

"You appear to be using Sass < 3.4! Please do this thing to your config so this will still work."

Personally, changing something to on by default feels like a breaking change, and Sass prolly shouldn't have done this in a point release :/

tbremer commented 9 years ago

This middle doesn't assume responsible for old SASS options.

You could downgrade to an earlier version, or upgrade your SASS version.

3.4.X brought in lots of great other features.

ThisGuyCodes commented 9 years ago

I know how to get this working; but every few months I run into this again getting something setup and am left confused for a short while because of how opaque this error is, and the first time I ran into it I was totally in the dark.

I didn't make this issue to ask for help getting it working, I'm asking to eliminate a point of confusion people run into when trying to use this (a feature request, if you will). If I was more familiar with making grunt commands I'd have just made a PR: would it be totally out of line to detect the Sass version and explain this failure? Which was the second part of my OP above.

sindresorhus commented 9 years ago

The readme explicitly says the sourcemap option requires Sass 3.4. Not gonna add code to detect older versions and handle that. Downgrade grunt-contrib-sass or upgrade Sass. Your choice.