use style tag can't work(CssSyntaxError)
See original GitHub issueVersion
15.0.0、15.0.6
Reproduction link
https://coding.net/u/huzedong2011/p/html/git
Steps to reproduce
1、npm i 2 、npm run build
What is expected?
<template>
<div>
<h1>Hello Word</h1>
<router-link to="/product">产品</router-link>
</div>
</template>
<style>
body {
background-color: #F00;
}
</style>
What is actually happening?
ERROR in ./src/pages/home/index.vue?vue&type=style&index=0&lang=css (./node_modules/_vue-loader@15.0.6@vue-loader/lib/loaders/stylePostLoader.js!./node_modules/_vue-style-loader@4.1.0@vue-style-loader!./node_modules/_css-loader@0.28.11@css-loader!./node_modules/_postcss-loader@2.1.4@postcss-loader/lib!./node_modules/_vue-loader@15.0.6@vue-loader/lib??vue-loader-options!./src/pages/home/index.vue?vue&type=style&index=0&lang=css) Module build failed: CssSyntaxError: D:\www\html\src\pages\home\index.vue:5:1: Unknown word at Input.error (D:\www\html\node_modules_postcss@6.0.22@postcss\lib\input.js:119:22) at Parser.unknownWord (D:\www\html\node_modules_postcss@6.0.22@postcss\lib\parser.js:506:26) at Parser.other (D:\www\html\node_modules_postcss@6.0.22@postcss\lib\parser.js:171:18) at Parser.parse (D:\www\html\node_modules_postcss@6.0.22@postcss\lib\parser.js:84:26) at parse (D:\www\html\node_modules_postcss@6.0.22@postcss\lib\parse.js:24:16) at new LazyResult (D:\www\html\node_modules_postcss@6.0.22@postcss\lib\lazy-result.js:70:24) at Processor.process (D:\www\html\node_modules_postcss@6.0.22@postcss\lib\processor.js:117:12) at compileStyle (D:\www\html\node_modules_@vue_component-compiler-utils@1.2.1@@vue\component-compiler-utils\dist\compileStyle.js:34:35) at Object.module.exports (D:\www\html\node_modules_vue-loader@15.0.6@vue-loader\lib\loaders\stylePostLoader.js:9:33) @ ./src/pages/home/index.vue?vue&type=style&index=0&lang=css 1:0-438 1:454-457 1:459-894 1:459-894 @ ./src/pages/home/index.vue @ ./src/router/index.js @ ./src/index.js @ multi ./node_modules/_webpack-dev-server@3.1.4@webpack-dev-server/client?http://0.0.0.0:8080 webpack/hot/dev-server ./src
V14.2.2 success V15.0.0 error
Issue Analytics
- State:
- Created 5 years ago
- Comments:22 (3 by maintainers)
Top GitHub Comments
@papac, i have the same error, did you solve this?
Hi, I have the same problem two. my project is at : https://github.com/banxi1988/FlaskVueDemo/tree/master/client
below is webpack.config.js
Once I add a
style
tag in the TodoItem.vue file, It will produce errors as follows:After some search problem still, So I try to find the reason myself. let me look at the output below.
_vue-loader@15.0.6@vue-loader/lib/loaders/stylePostLoader.js:10:33
In my opinion, I think the source should be a css source string, to me surprise the output was below:
hope this output will be help for the diagnose.