Libsass: Media query expression must begin with '('

Created on 28 Nov 2015  ·  7Comments  ·  Source: sass/libsass

@media all and (min-width: 901pt)                          { @import "l-xl.scss" }
@media all and (min-width: 601pt)  and (max-width: 900pt)  { @import "m-l.scss"  }
@media all and (min-width: 241pt)  and (max-width: 900pt)  { @import "s-m.scss"  }
@media all                         and (max-width: 900pt)  { @import "xs-m.scss" }
@media all                         and (max-width: 600pt)  { @import "xs-s.scss" }

@media all and (min-width: 1601pt)                         { @import "xl.scss" }
@media all and (min-width: 901pt)  and (max-width: 1600pt) { @import "l.scss"  }
@media all and (min-width: 601pt)  and (max-width: 900pt)  { @import "m.scss"  }
@media all and (min-width: 241pt)  and (max-width: 600pt)  { @import "s.scss"  }
@media all                         and (max-width: 240pt)  { @import "xs.scss" }

The error:

/~/css-loader?importLoaders=2&sourceMap!./~/autoprefixer-loader?browsers=last 2 version!./~/sass-loader?outputStyle=exp
nded&sourceMap=true&sourceMapContents=true!./assets/styles/style.scss
odule build failed:
media all and (min-width: 901pt)                          { @import "l-xl.scss" }
                                                                              ^
     Media query expression must begin with '('
     in G:\work\3\webapp\assets\styles\style.scss (line 363, column 81)
rror:
media all and (min-width: 901pt)                          { @import "l-xl.scss" }
                                                                              ^
     Media query expression must begin with '('
     in G:\work\3\webapp\assets\styles\style.scss (line 363, column 81)
   at options.error (G:\work\3\webapp\node_modules\node-sass\lib\index.js:277:32)
@ ./assets/styles/style.scss 4:14-281 13:2-17:4 14:20-287
Bug - Confirmed Dev - Test Written

Most helpful comment

also happens if you forget to add a semicolon ; after an @import "xyz";

All 7 comments

The error goes away when I put semicolons inside:

@media all and (min-width: 901pt)                          { @import "l-xl.scss"; }
@media all and (min-width: 601pt)  and (max-width: 900pt)  { @import "m-l.scss";  }
@media all and (min-width: 241pt)  and (max-width: 900pt)  { @import "s-m.scss";  }
@media all                         and (max-width: 900pt)  { @import "xs-m.scss"; }
@media all                         and (max-width: 600pt)  { @import "xs-s.scss"; }

@media all and (min-width: 1601pt)                         { @import "xl.scss"; }
@media all and (min-width: 901pt)  and (max-width: 1600pt) { @import "l.scss";  }
@media all and (min-width: 601pt)  and (max-width: 900pt)  { @import "m.scss";  }
@media all and (min-width: 241pt)  and (max-width: 600pt)  { @import "s.scss";  }
@media all                         and (max-width: 240pt)  { @import "xs.scss"; }

Thanks for the report @halt-hammerzeit. I can confirm this is an issue in 3.3.2.

I guess this issue can be closed for now since your tests pass.

also happens if you forget to add a semicolon ; after an @import "xyz";

@googol7 I have confirmed this issue and opened #2233 to track it. In future please create a new issue rather than commenting on old issues.

also happens if you forget to add a semicolon ; after an @import "xyz";

Man that just wasted some of my time, could we get some better error reporting on this one?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

xzyfer picture xzyfer  ·  9Comments

ashleykolodziej picture ashleykolodziej  ·  3Comments

bdkjones picture bdkjones  ·  6Comments

nex3 picture nex3  ·  9Comments

GottZ picture GottZ  ·  3Comments