@import appears broken #26

Closed
skagra opened this Issue May 28, 2012 · 9 comments

Comments

Projects
None yet
5 participants
@skagra

skagra commented May 28, 2012

Summary:

@import throws in 1.3.0.3 which worked correctly in 1.0.1

Environment:

grails: 2.0.4
lesscss-resources: 1.3.0.3
resources: 1.1.6
java: 1.6.0_31

Description:

web-app/less/base.less contains an import such as:

@import 'settings.less';

settings.less is also in web-app/less

grails dev run-app

throws with:

2012-05-28 16:33:34,188 [pool-7-thread-1] ERROR resourceMappers.LesscssResourceMapper - error compiling less file: /mnt/home/harveyp/.grails/2.0.4/projects/servicecatalog/tomcat/work/Tomcat/localhost/servicecatalog/grails-resources/less/base.less
org.lesscss.LessException: Couldn't load settings.less (0)
at org.lesscss.LessCompiler.compile(LessCompiler.java:252)
at org.lesscss.LessCompiler.compile(LessCompiler.java:302)
at org.lesscss.LessCompiler.compile(LessCompiler.java:326)
at org.lesscss.LessCompiler.compile(LessCompiler.java:292)
at org.lesscss.LessCompiler.compile(LessCompiler.java:279)
at LesscssResourceMapper.map(LesscssResourceMapper.groovy:31)
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:587)
at org.grails.plugin.resource.ResourceProcessor.prepareResource(ResourceProcessor.groovy:533)
at org.grails.plugin.resource.ResourceProcessor$_prepareSingleDeclaredResource_closure12.doCall(ResourceProcessor.groovy:602)
at org.grails.plugin.resource.util.ResourceMetaStore.addDeclaredResource(ResourceMetaStore.groovy:29)
at org.grails.plugin.resource.ResourceProcessor.prepareSingleDeclaredResource(ResourceProcessor.groovy:600)
at org.grails.plugin.resource.ResourceProcessor$_prepareResourceBatch_closure14.doCall(ResourceProcessor.groovy:625)
at org.grails.plugin.resource.ResourceProcessorBatch.each(ResourceProcessorBatch.groovy:8)
at org.grails.plugin.resource.ResourceProcessor.prepareResourceBatch(ResourceProcessor.groovy:621)
at org.grails.plugin.resource.ResourceProcessor.resourcesChanged(ResourceProcessor.groovy:804)
at org.grails.plugin.resource.ResourceProcessor.loadModules(ResourceProcessor.groovy:800)
at org.grails.plugin.resource.ResourceProcessor.reloadAll(ResourceProcessor.groovy:1056)
at ResourcesGrailsPlugin$_closure3.doCall(ResourcesGrailsPlugin.groovy:172)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.mozilla.javascript.JavaScriptException: object Object
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1057)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:854)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:426)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3178)
at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:175)
at org.mozilla.javascript.Context.evaluateString(Context.java:1111)
at org.lesscss.LessCompiler.compile(LessCompiler.java:238)
... 24 more

The plugin attempts to load the settings.less from the root directory of the project (incidentally moving settings.less to that location as a work around does not solve the problem).

@paulfairless

This comment has been minimized.

Show comment
Hide comment
@paulfairless

paulfairless Jun 5, 2012

Owner

I've tried the plugin with twitter bootstap which uses countless imports successfully, but not with grails 2.0.4.

The error looks like it could be a syntax issue in your settings.less. Could you provide an example config and files (or even better a test case) and I can investigate further.

Thanks
Paul

Owner

paulfairless commented Jun 5, 2012

I've tried the plugin with twitter bootstap which uses countless imports successfully, but not with grails 2.0.4.

The error looks like it could be a syntax issue in your settings.less. Could you provide an example config and files (or even better a test case) and I can investigate further.

Thanks
Paul

@paulfairless

This comment has been minimized.

Show comment
Hide comment
@paulfairless

paulfairless Jun 5, 2012

Owner

noticed that it works if you use double quotes:

@import "settings.less";

will update docs while I investigate this

Owner

paulfairless commented Jun 5, 2012

noticed that it works if you use double quotes:

@import "settings.less";

will update docs while I investigate this

@skagra

This comment has been minimized.

Show comment
Hide comment
@skagra

skagra Jun 5, 2012

Hi,

Thanks I will check is the morning ... I don't have access to the source
from home. All I can say for sure is that it all worked (and still works)
with version 1.0.1 of the plugin and with grails 2.0.3 and 2.0.4. Thanks
for getting back to me.

Paul.

On Tuesday, June 5, 2012, Paul Fairless wrote:

I've tried the plugin with twitter bootstap which uses countless imports
successfully, but not with grails 2.0.4.

The error looks like it could be a syntax issue in your settings.less.
Could you provide an example config and files (or even better a test case)
and I can investigate further.

Thanks
Paul


Reply to this email directly or view it on GitHub:

#26 (comment)

skagra commented Jun 5, 2012

Hi,

Thanks I will check is the morning ... I don't have access to the source
from home. All I can say for sure is that it all worked (and still works)
with version 1.0.1 of the plugin and with grails 2.0.3 and 2.0.4. Thanks
for getting back to me.

Paul.

On Tuesday, June 5, 2012, Paul Fairless wrote:

I've tried the plugin with twitter bootstap which uses countless imports
successfully, but not with grails 2.0.4.

The error looks like it could be a syntax issue in your settings.less.
Could you provide an example config and files (or even better a test case)
and I can investigate further.

Thanks
Paul


Reply to this email directly or view it on GitHub:

#26 (comment)

@skagra

This comment has been minimized.

Show comment
Hide comment
@skagra

skagra Jun 6, 2012

On 5 June 2012 21:16, Paul Fairless <
reply@reply.github.com

wrote:

noticed that it works if you use double quotes:

@import "settings.less";

Thanks. A quick initial test would seem to verify that double quotes
solves the problem.

http://grails.org/plugin/lesscss-resources does indeed show single quotes,
however http://lesscss.org/ shows double quotes.

IIUC you switched lesscss implementation with 1.3 version, I'd guess that
the old implementation was tolerant of single quotes whereas the new is not.

Thanks again,

Paul.

will update docs while I investigate this


Reply to this email directly or view it on GitHub:

#26 (comment)

skagra commented Jun 6, 2012

On 5 June 2012 21:16, Paul Fairless <
reply@reply.github.com

wrote:

noticed that it works if you use double quotes:

@import "settings.less";

Thanks. A quick initial test would seem to verify that double quotes
solves the problem.

http://grails.org/plugin/lesscss-resources does indeed show single quotes,
however http://lesscss.org/ shows double quotes.

IIUC you switched lesscss implementation with 1.3 version, I'd guess that
the old implementation was tolerant of single quotes whereas the new is not.

Thanks again,

Paul.

will update docs while I investigate this


Reply to this email directly or view it on GitHub:

#26 (comment)

@domurtag

This comment has been minimized.

Show comment
Hide comment
@domurtag

domurtag Dec 1, 2012

Could someone please update the docs with this info, I spent a lot of time trying to figure out what I was doing wrong

domurtag commented Dec 1, 2012

Could someone please update the docs with this info, I spent a lot of time trying to figure out what I was doing wrong

@lhanson

This comment has been minimized.

Show comment
Hide comment
@lhanson

lhanson Dec 27, 2012

Does the LESS syntax support single quotes and the Java library needs to be fixed, or is this merely a documentation error?

lhanson commented Dec 27, 2012

Does the LESS syntax support single quotes and the Java library needs to be fixed, or is this merely a documentation error?

@paulfairless

This comment has been minimized.

Show comment
Hide comment
@paulfairless

paulfairless Jan 21, 2013

Owner

docs updated.

there is an open issue with the compiler which includes supporting single quotes marceloverdijk/lesscss-maven-plugin#4

Owner

paulfairless commented Jan 21, 2013

docs updated.

there is an open issue with the compiler which includes supporting single quotes marceloverdijk/lesscss-maven-plugin#4

@lhanson

This comment has been minimized.

Show comment
Hide comment
@lhanson

lhanson Mar 2, 2013

FYI, the docs at http://grails.org/plugin/lesscss-resources say:

The import directive must use double quotes for the LESS compiler

but the example directly below still uses single quotes:
@import 'imported_style.less';

lhanson commented Mar 2, 2013

FYI, the docs at http://grails.org/plugin/lesscss-resources say:

The import directive must use double quotes for the LESS compiler

but the example directly below still uses single quotes:
@import 'imported_style.less';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment