CssSyntaxError使用Webpack构建时出现未知Word,但开发服务器运行正常

时间:2019-09-14 11:35:13

标签: vue.js webpack postcss webpack-style-loader postcss-loader

我是Vue和Webpack的新手 该项目正在我的开发服务器上运行,在我运行

时效果很好
npm run dev

但是当我跑步

npm run build

正在产生以下错误

     Error processing file: static/css

/app.81fa529b08a5e9b00d3a8b61096d58b1.css
(node:8608) UnhandledPromiseRejectionWarning: CssSyntaxError: I:\projects\Vue\getit\static\css\app.81fa529b08a5e9b00d3a8b61096d58b1.css:104:21: Unknown word
    at Input.error (I:\projects\Vue\getit\node_modules\optimize-css-assets-webpack-plugin\node_modules\postcss\lib\input.js:130:16)
    at Parser.unknownWord (I:\projects\Vue\getit\node_modules\optimize-css-assets-webpack-plugin\node_modules\postcss\lib\parser.js:563:22)
    at Parser.decl (I:\projects\Vue\getit\node_modules\optimize-css-assets-webpack-plugin\node_modules\postcss\lib\parser.js:235:16)
    at Parser.other (I:\projects\Vue\getit\node_modules\optimize-css-assets-webpack-plugin\node_modules\postcss\lib\parser.js:133:18)
    at Parser.parse (I:\projects\Vue\getit\node_modules\optimize-css-assets-webpack-plugin\node_modules\postcss\lib\parser.js:77:16)
    at parse (I:\projects\Vue\getit\node_modules\optimize-css-assets-webpack-plugin\node_modules\postcss\lib\parse.js:17:12)
    at new LazyResult (I:\projects\Vue\getit\node_modules\optimize-css-assets-webpack-plugin\node_modules\postcss\lib\lazy-result.js:60:16)
    at Processor.<anonymous> (I:\projects\Vue\getit\node_modules\optimize-css-assets-webpack-plugin\node_modules\postcss\lib\processor.js:138:12)
    at Processor.process (I:\projects\Vue\getit\node_modules\optimize-css-assets-webpack-plugin\node_modules\postcss\lib\processor.js:117:23)
    at Function.creator.process (I:\projects\Vue\getit\node_modules\optimize-css-assets-webpack-plugin\node_modules\postcss\lib\postcss.js:148:43)
    at OptimizeCssAssetsPlugin.processCss (I:\projects\Vue\getit\node_modules\optimize-css-assets-webpack-plugin\index.js:63:19)
    at Object.processor (I:\projects\Vue\getit\node_modules\optimize-css-assets-webpack-plugin\index.js:29:23)
    at I:\projects\Vue\getit\node_modules\last-call-webpack-plugin\index.js:139:8
    at arrayEach (I:\projects\Vue\getit\node_modules\lodash\_arrayEach.js:15:9)
    at forEach (I:\projects\Vue\getit\node_modules\lodash\forEach.js:38:10)
    at LastCallWebpackPlugin.process (I:\projects\Vue\getit\node_modules\last-call-webpack-plugin\index.js:136:3)
(node:8608) 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:8608) [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.

1 个答案:

答案 0 :(得分:0)

好,所以我刚刚解决了它,我在css 1

中插入了一些html代码