Vue-loader: sass loading failed: Invalid CSS after "html {": expected "}", was "{"

Created on 9 Mar 2016  ·  5Comments  ·  Source: vuejs/vue-loader

With a bran-new webpack project created by [email protected].

If the style section of App.vue is modified to

<style lang="sass">

And then I got node-sass and sass-loader installed.

eslint would complain
screen shot 2016-03-09 at 09 12 22

I can eliminate this error by making the style section inline

screen shot 2016-03-09 at 09 14 12

According to this sass issue, something may be appended to the style text. So I consider it as a vue-loader issue.

My environment:

screen shot 2016-03-09 at 09 18 52
screen shot 2016-03-09 at 09 19 05

Most helpful comment

lang="sass" uses the indented syntax, if you want the CSS-superset syntax, use lang="scss".

All 5 comments

lang="sass" uses the indented syntax, if you want the CSS-superset syntax, use lang="scss".

Cool, it fixed.

This error just popped up when I upgrade my project templates that generated 2 months ago by [email protected] to the latest. I did not get this error before, so I figured that it could be some updates in vue-loader cause the problem.

There are lots of updates. Great job. :)

您好,我在scss语法里面加rgba写法的颜色,会直接编译报错。不用这个写法就不会报错,正常编译。

image

842b1d5c-e5d7-11e5-95c0-8ea9a6747e53

SASS SYNTAX is incorrect. https://sass-lang.com/guide

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chrisvfritz picture chrisvfritz  ·  4Comments

githoniel picture githoniel  ·  3Comments

TheVexatious picture TheVexatious  ·  3Comments

frangio picture frangio  ·  3Comments

matt-sanders picture matt-sanders  ·  4Comments