PostCSS plugin xxx requires PostCSS 8
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.
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 [email protected]). 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).
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!