create-react-app: Bug: Cannot create a build of the project

React version: 17.0.2

Steps To Reproduce

  1. Clean install with npx create-react-app app-name (without Typescript)
  2. After install go in to folder and run npm run build.

The current behavior

You’ll get an error about the MiniCssExtractPlugin.

TypeError: MiniCssExtractPlugin is not a constructor

The expected behavior

It should create a build version of the app 🙂

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 6
  • Comments: 17

Commits related to this issue

Most upvoted comments

Downgrading the version fixed it, add this into package.json.

"resolutions": {
    "mini-css-extract-plugin": "2.4.5"
},

I faced the same problem and shared the solution here https://github.com/facebook/create-react-app/discussions/11934