grunt-postcss icon indicating copy to clipboard operation
grunt-postcss copied to clipboard

Warning: Cannot read property 'postcss' of undefined

Open mayeenulislam opened this issue 9 years ago • 1 comments

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?

mayeenulislam avatar Nov 30 '16 18:11 mayeenulislam

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%']})

Viveur avatar Dec 22 '17 08:12 Viveur