npm run build 打包vue-cli项目失败

打包直接报错,无法生成打包文件

> hzm_wap@1.0.0 build C:\Users\shend\Desktop\hzm_wap> node build/build.js
- building for production...Error processing file: static/css/app.f58dfc4095d0bb5a8de1d2eb75695025.css(node:11924) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'value' of undefined    at Parser.parentheses (C:\Users\shend\Desktop\hzm_wap\node_modules\postcss-selector-parser\dist\parser.js:309:13)
   at Parser.parse (C:\Users\shend\Desktop\hzm_wap\node_modules\postcss-selector-parser\dist\parser.js:533:22)
   at Parser.loop (C:\Users\shend\Desktop\hzm_wap\node_modules\postcss-selector-parser\dist\parser.js:519:18)
   at new Parser (C:\Users\shend\Desktop\hzm_wap\node_modules\postcss-selector-parser\dist\parser.js:104:21)
   at Processor.process (C:\Users\shend\Desktop\hzm_wap\node_modules\postcss-selector-parser\dist\processor.js:26:21)
   at getParsed (C:\Users\shend\Desktop\hzm_wap\node_modules\postcss-minify-selectors\dist\index.js:32:59)
   at optimise (C:\Users\shend\Desktop\hzm_wap\node_modules\postcss-minify-selectors\dist\index.js:139:21)
   at C:\Users\shend\Desktop\hzm_wap\node_modules\cssnano\node_modules\postcss\lib\container.js:241:28
   at C:\Users\shend\Desktop\hzm_wap\node_modules\cssnano\node_modules\postcss\lib\container.js:148:26
   at Root.each (C:\Users\shend\Desktop\hzm_wap\node_modules\cssnano\node_modules\postcss\lib\container.js:114:22)
   at Root.walk (C:\Users\shend\Desktop\hzm_wap\node_modules\cssnano\node_modules\postcss\lib\container.js:147:21)
   at Root.walkRules (C:\Users\shend\Desktop\hzm_wap\node_modules\cssnano\node_modules\postcss\lib\container.js:239:25)    at C:\Users\shend\Desktop\hzm_wap\node_modules\postcss-minify-selectors\dist\index.js:165:20
   at LazyResult.run (C:\Users\shend\Desktop\hzm_wap\node_modules\cssnano\node_modules\postcss\lib\lazy-result.js:274:20)
   at LazyResult.asyncTick (C:\Users\shend\Desktop\hzm_wap\node_modules\cssnano\node_modules\postcss\lib\lazy-result.js:189:32)
   at LazyResult.asyncTick (C:\Users\shend\Desktop\hzm_wap\node_modules\cssnano\node_modules\postcss\lib\lazy-result.js:201:22)
(node:11924) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:11924) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

第一行提示了个value undefined 这咋找啊....这么多代码

阅读 3.3k
2 个回答

问题已解决,是因为我写了个带有媒体查询的css文件,并且用','隔开了浏览器兼容,
参考链接链接描述

Webpack 什么版本,看提示应该是 postcsscssnano 配置错误,或版本不兼容

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题