optimize-css-assets-webpack-plugin icon indicating copy to clipboard operation
optimize-css-assets-webpack-plugin copied to clipboard

[6.0.0] PostCSS missing due to incorrect identification as peerDependency

Open johnhunter opened this issue 4 years ago • 2 comments

This may not be an issue with optimize-css-assets-webpack-plugin itself.

On upgrading from 5.0.4 to 6.0.0 webpack builds fail due to a missing postcss@8 dependency. This is odd because it is a dependency in the packable.json (confirmed in the installed package in node_modules). However npm ls postcss reports it as an unmet peer dependency. A workaround is to install it as a peer, but that shouldn't be necessary as it is already a dependency.

  • Webpack 4
  • npm 6.14.12
[webpack-cli] Error: PostCSS plugin postcss-discard-comments requires PostCSS 8.

johnhunter avatar May 17 '21 09:05 johnhunter

I'm seeing the same issue. I'm currently upgrading from 5.0.6 to 6.0.1 due to a vulnerability in a transitive dependency (normalize-url) and i'm being left with the following error:

├─┬ [email protected]
│ └── UNMET PEER DEPENDENCY [email protected] 

@johnhunter were you able to resolve your issue?

bendvc avatar Jul 06 '21 17:07 bendvc

The way I resolved it was to add postcss as a top level dependency. I've since upgraded to [email protected]. Just checked now and removing the postcss top level dependency has not caused the issue to recur but I've not tested in on CI yet.

johnhunter avatar Jul 06 '21 18:07 johnhunter

Stale issue. Closing.

johnhunter avatar Jul 19 '23 17:07 johnhunter