I encountered an issue with my .less file where it contains definitions that rely on variables from another file.
For example:
body {
font-family: @baseFontFamily;
font-size: @baseFontSize;
color: @textColor;
}
At first, IntelliJ displayed the variables as undefined. Upon compiling with Lessc, I came across the following error message:
TypeError: Cannot call method 'charAt' of undefined at getLocation (C:\PATH\npm\node_modules\less\lib\less\parser.js:212:34) at new LessError (C:\PATH\npm\node_modules\less\lib\less\parser.js:221:19) at Object.toCSS (C:\PATH\npm\node_modules\less\lib\less\parser.js:385:31) at C:\PATH\npm\node_modules\less\bin\lessc:107:28 at C:\PATH\npm\node_modules\less\lib\less\parser.js:434:40 at C:\PATH\npm\node_modules\less\lib\less\parser.js:94:48 at C:\PATH\npm\node_modules\less\lib\less\index.js:116:17 at C:\PATH\npm\node_modules\less\lib\less\parser.js:434:40 at C:\PATH\npm\node_modules\less\lib\less\parser.js:94:48 at C:\PATH\npm\node_modules\less\lib\less\index.js:116:17
Upon researching, I concluded that there was an error within my code. My initial assumption was that the issue stemmed from the variable definition not functioning correctly. When commenting out the lines containing variables, lessc compiled the project without any problems.
However, even after adding the necessary @import statement to define the variables (and uncommenting the variable lines), I still encountered the compile-time error. Is there something crucial that I am overlooking?