Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unexpected token ILLEGAL in concatenated CSS file

I'm getting the following error in the Chrome console:

Uncaught SyntaxError: Unexpected token ILLEGAL

At the start of my concatenated CSS file:

@import url("http://fonts.googleapis.com/css?family=Raleway:300,400,600")

This line ends up on its own, and it's specifically this line that throws the error:

enter image description here

I've had a look around and it seems this error should relate to invisible characters making their way into the code. Unfortunately in my case that doesn't seem to be true. I've even deleted this portion of code and re-written it by hand to make sure - no difference.

I use Stylus (with gulp) and the resulting compile is naturally what throws the error - is this maybe an issue with gulp-stylus? I've looked at the compiled code and can't track down any invisible characters there either…

Does anything else throw this error?

like image 396
Nathan Hornby Avatar asked Aug 03 '15 10:08

Nathan Hornby


1 Answers

The error implies you are trying to load the style sheet with <script> instead of <link rel=stylesheet>.

CSS is not JavaScript and can't be treated as such.

like image 77
Quentin Avatar answered Sep 21 '22 02:09

Quentin