Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation error with "&:extend" #55

Closed
dosaki opened this issue Mar 4, 2014 · 2 comments
Closed

Compilation error with "&:extend" #55

dosaki opened this issue Mar 4, 2014 · 2 comments

Comments

@dosaki
Copy link

dosaki commented Mar 4, 2014

Hello,

There seems to be a problem when dealing with less files that use "&:extend" inside of a less class.
I came across this problem while attempting to use lesscss-resources to compile bootstrap.

Is this issue known? (or is it even an issue?)

This is my module configuration:

bootstrap {
        resource url:'less/bootstrap/less/bootstrap.less', attrs:[rel: "stylesheet/less", type:'css'], bundle:'bundle_bootstrap'
        resource url:'css/empty.css'
    }
}

This is the block where the compilation fails (at &:extend(.clearfix all);)

// Centered container element
.container-fixed() {
  margin-right: auto;
  margin-left: auto;
  padding-left:  (@grid-gutter-width / 2);
  padding-right: (@grid-gutter-width / 2);
  &:extend(.clearfix all);
}

This is the error that I get:

[pool-3-thread-1] resourceMappers.LesscssResourceMapper error compiling less file: /tmp/Jetty_0_0_0_0_8080_web.app____.63hdfb/grails-resources/less/bootstrap/less/bootstrap.less
org.lesscss.LessException: Syntax Error on line 1474
    at org.lesscss.LessCompiler.compile(LessCompiler.java:283)
    at org.lesscss.LessCompiler.compile(LessCompiler.java:335)
    at org.lesscss.LessCompiler.compile(LessCompiler.java:359)
    at org.lesscss.LessCompiler.compile(LessCompiler.java:325)
    at org.lesscss.LessCompiler.compile(LessCompiler.java:312)
    at LesscssResourceMapper.map(LesscssResourceMapper.groovy:35)
    at org.grails.plugin.resource.mapper.ResourceMapper.invoke(ResourceMapper.groovy:139)
    at org.grails.plugin.resource.mapper.ResourceMapper.invokeIfNotExcluded(ResourceMapper.groovy:128)
    at org.grails.plugin.resource.ResourceProcessor.applyMappers(ResourceProcessor.groovy:576)
    at org.grails.plugin.resource.ResourceProcessor.prepareResource(ResourceProcessor.groovy:543)
    at org.grails.plugin.resource.ResourceProcessor$_prepareSingleDeclaredResource_closure13.doCall(ResourceProcessor.groovy:600)
    at org.grails.plugin.resource.util.ResourceMetaStore.addDeclaredResource(ResourceMetaStore.groovy:29)
    at org.grails.plugin.resource.ResourceProcessor.prepareSingleDeclaredResource(ResourceProcessor.groovy:598)
    at org.grails.plugin.resource.ResourceProcessor$_prepareResourceBatch_closure15.doCall(ResourceProcessor.groovy:623)
    at org.grails.plugin.resource.ResourceProcessorBatch.each(ResourceProcessorBatch.groovy:8)
    at org.grails.plugin.resource.ResourceProcessor.prepareResourceBatch(ResourceProcessor.groovy:619)
    at org.grails.plugin.resource.ResourceProcessor.resourcesChanged(ResourceProcessor.groovy:778)
    at org.grails.plugin.resource.ResourceProcessor.loadResources(ResourceProcessor.groovy:815)
    at org.grails.plugin.resource.ResourceProcessor.reloadChangedFiles(ResourceProcessor.groovy:987)
    at ResourcesGrailsPlugin$_closure4_closure20.doCall(ResourcesGrailsPlugin.groovy:206)
    at ResourcesGrailsPlugin$_triggerReload_closure7.doCall(ResourcesGrailsPlugin.groovy:192)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:165)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:701)
Caused by: org.mozilla.javascript.JavaScriptException: [object Object] (doIt.js#1)
    at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1018)
    at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:815)
    at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:109)
    at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:394)
    at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3091)
    at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:107)
    at org.lesscss.LessCompiler.compile(LessCompiler.java:270)
    ... 28 more

I wasn't sure where I should have reported this so I'm sorry if this should have been reported in Java Less Compiler

@timbonicus
Copy link

It's related to #51 - extend is a LESS 1.4 feature, the plugin is still on LESS 1.3.

@dosaki
Copy link
Author

dosaki commented Mar 6, 2014

Ah thanks. I'll close this issue then.

@dosaki dosaki closed this as completed Mar 6, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants