简体   繁体   中英

Node-SASS Compiler fails - Invalid CSS

I am trying to compile a .sass file using the node-sass module from a nodejs application. However the compile fails with an Invalid CSS Error.

Here is my SCSS:

body {
    background: rgb(255, 0, 0);
}

Here is the full error message:

Original Error: { [Error: Invalid CSS after "body {": expected "}", was "{"]
status: 1,
file: 'C:/localhost/NodeJS-Server/private/sass/style.sass',
line: 2,
column: 7,
message: 'Invalid CSS after "body {": expected "}", was "{"',
formatted: 'Error: Invalid CSS after "body {": expected "}", was "{"\n on line 2 of private/sass/style.sass\n>> body { {\n   ------^\n' }

I have no idea where this second '{' comes from.

SCSS files use the .scss extension, not .sass. The two formats have a different syntax.

Read about the differences here: https://responsivedesign.is/articles/difference-between-sass-and-scss

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM