$ vue-cli-service build
 
⠋  Building for production... ERROR  TypeError: Class extends value undefined is not a constructor or null
TypeError: Class extends value undefined is not a constructor or null
    at Object.<anonymous> (/root/deploy/ui/node_modules/mini-css-extract-plugin/dist/CssDependency.js:12:46)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/root/deploy/ui/node_modules/mini-css-extract-plugin/dist/index.js:12:45)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)

装 npm install --save-dev mini-css-extract-plugin 即可  https://www.npmjs.com/package/mini-css-extract-plugin

还有升级webpack的方法,也可以修复这个问题 , 但是我用下面升级webpack后 package.json不兼容

npm install webpack -g // 全局安装
npm install webpack --save-dev // 项目内安装
或者
npm add webpack@latest --registry=https://registry.npm.taobao.org

 

Logo

前往低代码交流专区

更多推荐