Skip to content

[V5] PostCSS 8 error while building #11811

Closed
@BrodaNoel

Description

@BrodaNoel

Describe the bug

While running env-cmd -f .env.staging react-scripts build
I'm getting the following error:

Creating an optimized production build...
(node:44878) [DEP_WEBPACK_COMPILATION_NORMAL_MODULE_LOADER_HOOK] DeprecationWarning: Compilation.hooks.normalModuleLoader was moved to NormalModule.getCompilationHooks(compilation).loader
(Use `node --trace-deprecation ...` to show where the warning was created)
Failed to compile.

static/css/5068.bd16ed94.chunk.css from Css Minimizer plugin
Error: PostCSS plugin postcss-discard-comments requires PostCSS 8.
Migration guide for end-users:
https://github.com/postcss/postcss/wiki/PostCSS-8-for-end-users


npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build:staging: `env-cmd -f .env.staging react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build:staging script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/noel/.npm/_logs/2021-12-20T19_55_17_952Z-debug.log

The migration guide, clearly doesn't help. It's talking about CRA 3

Did you try recovering your dependencies?

I tried removing and adding everything 3 million times, as usual.

Which terms did you search for in User Guide?

  • postcss
  • v4
  • css

Environment

I can't because some company policies.
I'm using MacOS

Steps to reproduce

Just run your build command (mine is env-cmd -f .env.staging react-scripts build). My command was working properly during 4 years. Broken after upgrading to V5

Expected behavior

It should builds

Actual behavior

Not building.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions