Skip to content

use style tag can't work(CssSyntaxError) #1284

Closed
@huzedong2015

Description

@huzedong2015

Version

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


image

V14.2.2 success
V15.0.0 error

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions