Please provide better error handling
jithine opened this issue · comments
I had a variable used which was not defined
$inactiveText: $grey;
$grey
was not defined and this causes postcss to just ignore all css files which depends on this rule. No error/warning is thrown which makes it difficult to figure out what is happening.
@jithin1987 if you are not set silent
or unknow
option, plugin should raise a error: https://github.com/postcss/postcss-simple-vars/blob/master/test/test.js#L66-L70
Beacuse you said that files was ignored, I think it if build tool issue, when it catch and hide all errors from PostCSS.
What build tool are you use and what config you set?
I am using grunt-postcss
for build. This is my config
postcss: {
options: {
failOnError: true,
processors: [
require('postcss-import'),
require('postcss-nested')(),
require('postcss-simple-vars')({variables: require('css-vars')}),
require('postcss-extend')(),
require('autoprefixer')({browsers: 'last 2 versions'})
]
},
dist: {
files: [{
expand: true,
ext: '.css',
dest: 'dist/',
src: ['css/*.css']
}]
}
},
Output when there is an error as I described in description
> grunt postcss
Running "postcss:dist" (postcss) task
>> 1 processed stylesheet created.
Done, without errors.
Output when there is no error
> grunt postcss
Running "postcss:dist" (postcss) task
>> 7 processed stylesheets created.
Done, without errors.
When there is an error files are just not processed, leading to long debug times. That number is easy to miss.
@nDmitry can you help here? Seems like grunt-postcss hides some errors.
Do it issue releated? nDmitry/grunt-postcss#70
@ai should be fixed in 0.7.1.
Thanks a lot @nDmitry. The I see proper failure now.