Search code examples
lesswebstormtwitter-bootstrap-2

Can no longer compile bootstrap 2.3.2 LESS with Webstorm 8.0.2. LESS compile plugin. Getting compiler error(s)


I am updating one of my old projects which used Botstrap v2.3.2 with LESS. It used to compile without a hitch, but now I am getting this error:

LESS CSS Compiler Error
mixins.less: Parse Error: Unrecognised input (line 561, column 6) near .spanX 
(@index) when (@index > 0) { (~".span@{index}") { .span(@index); } .spanX(@index - 1);

The problem appears to be here:

.spanX (@index) when (@index > 0) {
  (~".span@{index}") { .span(@index); } // <-- line 561 in mixins.less
  .spanX(@index - 1);
}

Not sure what the problem is. Any thoughts?


Solution

  • As seven-phases-max redirects in his comment: https://stackoverflow.com/a/19553368/2712740

    changed all instances where the error appeared from

      (~".span@{index}") { .span(@index); } // <-- line 561 in mixins.less
    

    to

      .span@{index} { .span(@index); } // <-- line 561 in mixins.less
    

    This was due to some breaking change in the new version of LESS compiler. As annoying as they are, this breaking change is definitely for the good (as always, the less boilerplate the better).
    cheers