Warning: Cannot read property 'postcss' of undefined
The grunt command is breaking build with a warning. The problem started in Travis-CI and now it's displaying in local Windows install too:
Running "postcss:dist" (postcss) task Warning: Cannot read property 'postcss' of undefined Use --force to continue.
Aborted due to warnings. Script grunt handling the post-install-cmd event returned with error code 3
My Gruntfile.js and package.json are here
We tried solving some issues in StackOverflow, and figured out two things:
- node version needs to be >=4
-
require('es6-promise').polyfill()is important because postcss withdrawn es6-promise support
But still it's not proceeding further. :disappointed:
What's wrong with my process using grunt-postcss?
I had this exact error.
In my case I had: require('autoprefixer')({ browsers: ['> 1%']}).postcss
And fixed it by removing the .postcss at the end, ie: require('autoprefixer')({ browsers: ['> 1%']})