This error can also occur as a result of incorrect import in the files you import.
I also ran into this problem when using multiple import levels and the 'lessc' compiler from Node.js:
- The original file imported the file (which we will call the "child")
- The child file imported the file (which we will call the "grandson")
- Grandson was imported
I tried to compile the source file and got the same undefined variable behavior. I could see that the variable was defined in the child, and the syntax looked correct.
There were no errors.
The problem was that the child did not import the grandson properly. Those.,
@import grandchild.less
but not:
@import "grandchild.less";
Committing the grandson's child property made the source file available to the variables defined in the child element.
It seems that the error is less - i.e. a bad import should appear on the output of "lessc", so one day it will probably be fixed. Until then, I hope this helps.
mikemaccana Nov 07 '12 at 12:35 2012-11-07 12:35
source share