Error: [object Object] is not a PostCSS plugin

See original GitHub issue

I just happened to setup a new workstation, installed some tools to process SASS files and called something like npm i -g node-sass postcss postcss-cli clean-css-cli autoprefixer browserslist on the command line. I tried to prefix a css files using a statement like postcss expanded.css -u autoprefixer -o prefixed.css --no-map and got error Error: [object Object] is not a PostCSS plugin I downgraded to autoprefixer@9 and the error went away. I see version 10 had just been pushed. Is there an issue?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:18
  • Comments:27 (9 by maintainers)

github_iconTop GitHub Comments

36reactions
mwmcodecommented, Sep 16, 2020

had Error: true is not a PostCSS plugin after upgrading to v10.

Then I read the changelog which mentions postcss being moved to peerDep

so I npm i postcssed and it went away

10reactions
evanleckcommented, Sep 15, 2020

Same here:

TypeError: Invalid PostCSS Plugin found at: plugins[0]

(@/home/evan/Code/prepaid/web/postcss.config.js)
    at /home/evan/Code/prepaid/web/node_modules/.pnpm/postcss-load-config@2.1.0/node_modules/postcss-load-config/src/plugins.js:72:15
    at Array.forEach (<anonymous>)
    at plugins (/home/evan/Code/prepaid/web/node_modules/.pnpm/postcss-load-config@2.1.0/node_modules/postcss-load-config/src/plugins.js:58:13)
    at processResult (/home/evan/Code/prepaid/web/node_modules/.pnpm/postcss-load-config@2.1.0/node_modules/postcss-load-config/src/index.js:33:14)
    at /home/evan/Code/prepaid/web/node_modules/.pnpm/postcss-load-config@2.1.0/node_modules/postcss-load-config/src/index.js:94:14
    at async Promise.all (index 0)

My postcss.config.js:

/* eslint-env node */
module.exports = {
  plugins: [
    require('autoprefixer'),
    require('cssnano')({
      preset: ['advanced', {
        autoprefixer: false,
        discardComments: {
          removeAll: true
        }
      }]
    })
  ]
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

PostCSS error: [object Object] is not a PostCSS plugin
I'm trying to add cssnano and autoprefixer to the postcss plugin. gulp/node_modules/gulp-postcss/node_modules/postcss/lib/processor.js:143 throw ...
Read more >
postcss/postcss - Gitter
So, not sure what kind of setup is necessary to process such a simple use case. ... getting an error Error: [object Object]...
Read more >
[postcss-url] Error: [object Object] is not a PostCSS plugin
This is my postcss configuration code in rollup.config.js file: const postcssUrlOpts = [ { url: 'copy', filter: /\.woff$/, ...
Read more >
[object Object] is not a PostCSS plugin_敲出真谛的博客
然后运行npm run dev 就会报错. [object Object] is not a PostCSS plugin. 查询资料说安装的postcss-pxtorem 版本太高目前是6.xx版本.
Read more >
[Solved]-object Object is not a PostCSS plugin - appsloveworld
[Solved]-object Object is not a PostCSS plugin | PostCSS Autoprefixer-grunt.js. Search. score:0. It turns out it was just a version compatibility issue.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found