Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LESS Ruby Compiler Error

Tags:

css

less

Out of nowhere, all of my stylesheets started throwing errors during compilation.

lessc static/css/styles.less
/gems/less-2.2.1/lib/less/js/lib/less/parser.js:385:31: .rounded_corners is undefined (Less::Error)

None of my mixins seem to be available in the main less file. The mixins.less file is imported at the very top of my stylesheet and is only imported once.

@import "mixins.less";
@import "reset.less";
@import "clearfix.less";
@import etc..

I've also checked each file for a Byte Order Mark, inspired by Variable Name Error "is undefined" even though "variables.less" imported, and even went back 4 weeks in this project's git history (where I'm 100% sure compilation ran successfully). I have had no luck thus far.

Oddly enough, compilation runs successfully using SimpLESS and Less Compiler for Mac.

I've narrowed this down to an importing issue because if I attempt to use a mixin at the top of the stylesheet and error is thrown with that mixin's name.

Anyone familiar with this situation?

I'm using version 2.2.1 of the Less Ruby Gem.

like image 711
muffs Avatar asked Nov 14 '22 03:11

muffs


1 Answers

I think you need to be in the directory that contains the file you are trying to compile. Instead of running the command as:

lessc static/css/styles.less

try:

cd static/css
lessc styles.less
like image 178
Shreyans Avatar answered Dec 23 '22 06:12

Shreyans