Administrator
Published on 2022-06-14 / 591 Visits
0
0

npm run build 报错TypeError: Class extends value undefined is not a constructor or null

npm run build 报错TypeError: Class extends value undefined is not a constructor or null

在执行npm run build的时候遇到了错误:TypeError: Class extends value undefined is not a constructor or null;而执行npm run serve是可以正常执行的,报错如下:

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
  • 第一是安装这个插件:
npm install --save-dev mini-css-extract-plugin //在项目开发依赖中安装

第二是升级webpack版本(如果无效可以先卸载,再安装):

npm install webpack -g // 全局安装
npm install webpack --save-dev //在项目开发依赖中安装

Comment