[Solved] `npm run build`, error `TypeError: MiniCssExtractPlugin is not a constructor` - How to fix

React JS Ab Siddik

Problem:

Recently, we working on a SPA(Single page application), we used React to develop this application. But when we try to build our application we face that getting error on running command - 

`npm run build`, error `TypeError: MiniCssExtractPlugin is not a constructor`


Solution:

We found that this problem happens cause there are changes for mini-css-extract-plugin in version "2.5.0". So we uninstall this version and install the older version 2.4.5 to solve this issue quickly.


Uninstall version 2.5.0:

npm uninstall mini-css-extract-plugin


Install version 2.4.5:

npm i -D --save-exact mini-css-extract-plugin@2.4.5

Thank you for reading the article. Hope the given solution will solve your problem.