美文网首页
vue项目打包报错解决

vue项目打包报错解决

作者: Poppy11 | 来源:发表于2020-06-18 16:52 被阅读0次

    打包时项目报错

    \ building for production...Error processing file: static/css/app.4ebb9f9883beef537466e865360a12aa.css
    (node:7512) UnhandledPromiseRejectionWarning: CssSyntaxError: D:\work\memberweb-ui\static\css\app.4ebb9f9883beef537466e865360a12aa.css:703:6: Unknown word
        at Input.error (D:\work\memberweb-ui\node_modules\optimize-css-assets-webpack-plugin\node_modules\postcss\lib\input.js:130:16)
        at Parser.unknownWord (D:\work\memberweb-ui\node_modules\optimize-css-assets-webpack-plugin\node_modules\postcss\lib\parser.js:563:22)
        at Parser.decl (D:\work\memberweb-ui\node_modules\optimize-css-assets-webpack-plugin\node_modules\postcss\lib\parser.js:235:16)
        at Parser.other (D:\work\memberweb-ui\node_modules\optimize-css-assets-webpack-plugin\node_modules\postcss\lib\parser.js:133:18)
        at Parser.parse (D:\work\memberweb-ui\node_modules\optimize-css-assets-webpack-plugin\node_modules\postcss\lib\parser.js:77:16)
        at parse (D:\work\memberweb-ui\node_modules\optimize-css-assets-webpack-plugin\node_modules\postcss\lib\parse.js:17:12)
        at new LazyResult (D:\work\memberweb-ui\node_modules\optimize-css-assets-webpack-plugin\node_modules\postcss\lib\lazy-result.js:60:16)
        at Processor.<anonymous> (D:\work\memberweb-ui\node_modules\optimize-css-assets-webpack-plugin\node_modules\postcss\lib\processor.js:138:12)
        at Processor.process (D:\work\memberweb-ui\node_modules\optimize-css-assets-webpack-plugin\node_modules\postcss\lib\processor.js:117:23)
        at Function.creator.process (D:\work\memberweb-ui\node_modules\optimize-css-assets-webpack-plugin\node_modules\postcss\lib\postcss.js:148:43)
        at OptimizeCssAssetsPlugin.processCss (D:\work\memberweb-ui\node_modules\optimize-css-assets-webpack-plugin\index.js:63:19)
        at Object.processor (D:\work\memberweb-ui\node_modules\optimize-css-assets-webpack-plugin\index.js:29:23)
        at D:\work\memberweb-ui\node_modules\last-call-webpack-plugin\index.js:139:8
        at arrayEach (D:\work\memberweb-ui\node_modules\lodash\_arrayEach.js:15:9)
        at forEach (D:\work\memberweb-ui\node_modules\lodash\forEach.js:38:10)
        at LastCallWebpackPlugin.process (D:\work\memberweb-ui\node_modules\last-call-webpack-plugin\index.js:136:3)
    (node:7512) 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: 2)
    (node:7512) [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.
    

    解决,在build->webpack.prod.conf.js文件吧下面代码注释掉

    //const OptimizeCSSPlugin = require(‘optimize-css-assets-webpack-plugin’)
    //new OptimizeCSSPlugin({
    // cssProcessorOptions: config.build.productionSourceMap
    //? { safe: true, map: { inline: false } }
    // : { safe: true }
    //}),
    
    

    相关文章

      网友评论

          本文标题:vue项目打包报错解决

          本文链接:https://www.haomeiwen.com/subject/nowuxktx.html