Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Media query expression must begin with '(' #1766

Closed
catamphetamine opened this issue Nov 28, 2015 · 7 comments
Closed

Media query expression must begin with '(' #1766

catamphetamine opened this issue Nov 28, 2015 · 7 comments

Comments

@catamphetamine
Copy link

@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
@catamphetamine
Copy link
Author

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"; }

@xzyfer
Copy link
Contributor

xzyfer commented Dec 1, 2015

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

xzyfer added a commit to xzyfer/sass-spec that referenced this issue Dec 1, 2015
@xzyfer
Copy link
Contributor

xzyfer commented Dec 1, 2015

Spec added sass/sass-spec#634

@catamphetamine
Copy link
Author

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

@googol7
Copy link

googol7 commented Nov 23, 2016

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

@xzyfer
Copy link
Contributor

xzyfer commented Dec 5, 2016

@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.

@telamon
Copy link

telamon commented Nov 24, 2018

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants