egoist / rollup-plugin-postcss

Seamless integration between Rollup and PostCSS.
MIT License
673 stars 212 forks source link

PostCSS plugin xxx requires PostCSS 8 #380

Open nico-martin opened 3 years ago

nico-martin commented 3 years ago

I'm getting the following error:

[!] (plugin postcss) Error: PostCSS plugin postcss-nested requires PostCSS 8. Migration guide for end-users: https://github.com/postcss/postcss/wiki/PostCSS-8-for-end-users

But the thing is I'm already using PostCSS 8 and the latest version of rollup-plugin-postcss. So everything the Migration Guide recommends:

    "postcss": "^8.3.2",
    "postcss-import": "^14.0.2",
    "postcss-nested": "^5.0.5",
    "rollup": "^2.44.0",
    "rollup-plugin-postcss": "^4.0.0",

Any ideas why this error still appears? This happens with various PostCSS plugins.

bidorffOL commented 3 years ago

I have been having the same problem as well. However, I'm wondering if that could be related to cssnano still being in version 4.1.11 (and pulling with it postcss@7.0.36). So this may be solved by #357.

Someone mentioned here that rolling back to 3.1.8 may solve the problem (it does for me).

ldeveber commented 2 years ago

I tried upgrading cssnano but that did not work. I use storybook and the webpack 4 adapter still pulls in an old version of postcss (I believe they're dropping it completely in the next major release? I'm already using the experimental webpack 5 version). Adding this to my package.json worked for me:

  "resolutions": {
    "postcss": "^8.3.6"
  },

This obviously won't work for people who still need to rely on other things that need old postcss, but if you can upgrade all those things this worked!