Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

345
Views
Error de MiniCssExtractPlugin cuando ejecuto npm run build

Estoy tratando de ejecutar "Npm Run Build" en mi sitio web de reactjs, pero sigo recibiendo este error:

 /usr/local/lib/node_modules/react-scripts/config/webpack.config.js:664 new MiniCssExtractPlugin({ ^ TypeError: MiniCssExtractPlugin is not a constructor

He buscado otras soluciones a este problema que dicen ejecutar este comando:

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

Otro dice que elimine node_modules y package.lock.json, ninguno de los dos funcionó para mí.

Esto es lo que mi paquete.json:

 { "name": "web-client", "version": "0.1.0", "private": true, "dependencies": { "@material-ui/core": "^4.12.3", "@testing-library/jest-dom": "^5.14.1", "@testing-library/react": "^11.2.7", "@testing-library/user-event": "^12.8.3", "axios": "^0.21.1", "bootstrap": "^5.1.0", "emailjs-com": "^3.2.0", "get-video-duration": "^4.0.0", "nodemailer": "^6.7.2", "prop-types": "^15.7.2", "react": "^17.0.2", "react-bootstrap": "^1.6.1", "react-dom": "^17.0.2", "react-dropzone": "^11.3.4", "react-icons": "^4.2.0", "react-modal": "^3.14.3", "react-router-dom": "^5.2.0", "react-s3-uploader": "^5.0.0", "react-scripts": "4.0.3", "styled-components": "^5.3.0", "web-vitals": "^1.1.2" }, "scripts": { "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject" }, "eslintConfig": { "extends": [ "react-app", "react-app/jest" ] }, "browserslist": { "production": [ ">0.2%", "not dead", "not op_mini all" ], "development": [ "last 1 chrome version", "last 1 firefox version", "last 1 safari version" ] }, "resolutions": { "mini-css-extract-plugin": "2.4.5" } }

Alguien sabe porque esto no funciona??

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Esto se debe a una actualización de la versión 2.5.0.

La versión 2.5.1 debería resolver este problema, así que instálela si puede.

Si no puede, intente dos cosas:

Tal vez las resolutions no funcionen debido a un problema de caché:

rm -rf node_modules && npm cache clean --force && npm i

¿Sigue sin funcionar? Cambiar la importación:

const { default: MiniCssExtractPlugin } = require('mini-css-extract-plugin');

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!