14

I keep getting this weird error message when compiling. Very hard to debug. (By the way: opacity in the example is a mixin)

But I'm stuck on

> 59| .red { opacity 0.4 }

expected "indent", got "eos"

I've tried

.red { opacity(0.4) }
.red { opacity(0.4); }

and nothing.

Claudiu
  • 3,700
  • 1
  • 38
  • 35

6 Answers6

17

I've also found that you can get this error if you mix spaces and tabs. It's a strange error to get for this issue. Just make sure that you stick with one or the other.

Garrett
  • 181
  • 1
  • 4
  • Good stuff. Just to add to this, all my files broke when I added syntax specific options into Sublime Text. Having `translate_tabs_to_spaces` set to false was the culprit. – adrianmcli Jan 26 '15 at 21:18
  • A tip if using vim, you can see hidden characters with :list – user115014 May 07 '15 at 16:26
9

I found this was caused by an erroneous curly brace left behind when conversing css or a mixin

myMixin(var = 1){  <--- nooooooo
  color red
  etc etc
sidonaldson
  • 24,431
  • 10
  • 56
  • 61
4

Problem A

The issue is that for some syntax reasons, stylus doesn't permit mixins alone in a selector

The solution(s)

  1. is to use multi line

    .red {
         opacity(0.4);
    }
    
  2. add a bogus property (make sure it doesn't affect your styling)

    .red { opacity(0.4); zoom:1; }
    

Problem B

Another issue was with reset styles, being without a new line between them.

body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none} ...

The solution

To put each of the style on individual lines:

body{line-height:1}
ol,ul{list-style:none}
blockquote,q{quotes:none}
...

Very very weird issues and even weirder solution :P

Hope that this save some of your time (because I've wasted a lot of mine on this :( ).

Bernhard Barker
  • 54,589
  • 14
  • 104
  • 138
Claudiu
  • 3,700
  • 1
  • 38
  • 35
0

I just had the same problem. As it turns out, this problem can also be caused if you have two consecutive, adjacent hashes when defining a color:

color #FFF  <- good

color ##FFF  <- easy to miss, will cause very unhelpful 'eos' message at file end
James M. Lay
  • 2,270
  • 25
  • 33
0

I had this issue and (after about 30 min) realized it was an extra opening brace that my IDE put in - clearly I should have been watching more carefully! I would suggest looking at all your git (or what have you) changes very carefully and be sure you have no double opening braces:

.class-name-of-greatness {
{ 
   color: blue;
   border: gold
}
R Claven
  • 1,160
  • 2
  • 13
  • 27
0

For all the Vi(m) users: Can also be triggered by

$width--s = 24rem:wq

(last 3 chars)