- Instant help with your JavaScript coding problems

Fix the TypeError: MiniCssExtractPlugin is not a constructor

A small bug is present in MiniCssExtractPlugin 2.5.0 that causes the following error: 

TypeError: MiniCssExtractPlugin is not a constructor

 

Solution 1

Fortunately, this error was already fixed in version 2.5.1 so a simple update can solve this problem

Solution 2

If for any reason you cannot update the package, you can use the following syntax in your webpack config file:

const MiniCssExtractPlugin = require("mini-css-extract-plugin").default; 

 

Share "Fix the TypeError: MiniCssExtractPlugin is not a constructor" with your friends