SomMeri / less4j

Less language is an extension of css and less4j compiles it into regular css. Less adds several dynamic features into css: variables, expressions, nested rules, and so on. Less was designed to be compatible with css and any correct css file is also correct less file.
145 stars 47 forks source link

@import (optional) not working #276

Closed twhoff closed 9 years ago

twhoff commented 9 years ago

When specifying a less import as (optional), the compiler is still trying to find the file and throwing a critical error.

Also, in the documentation on on the wiki (https://github.com/SomMeri/less4j/wiki/Less-Language-Import), the example uses a different parameter (options) instead of (optional) which still doesn't work.

@import (options) "does-not-exist.less";
.grass {
  color: green;
}

For example:

@import (optional) "/does-not-exist.less";

or

@import (options) "/does-not-exist.less";

Gets compilation error (output changed as per example file):

resource.ImportLoader - Could not locate Less import: /does-not-exist.less
resource.WebResourceRepository - ResourceRenderingEngineMessage.RENDER_RESOURCE_ERROR Error while rendering resource /does-not-exist.less size=0
java.io.IOException: java.lang.NullPointerException
    at com.r9.nucleus.web.less.LessEngine2.render(LessEngine2.java:68)
    at com.r9.nucleus.web.resource.LessProcessor.render(LessProcessor.java:30)
twhoff commented 9 years ago

Sorry I think this might actually be something related to what the engineering team in my company has done, they've overriden the import loader class for their own purposes and ignored anything to do with less conventions >:(