If I call any of my variables in dotless, or mixins for that matter, the resulting CSS file is empty.
My setup is as follows:
- I have an import file which imports all of my other dotless based css files
- The first import is variables
- The second import is mixins (methods)
- Followed by any other files I need
So the file 00.1.import.less
will have the following content:
@import "00.2.variables";
@import "00.3.methods";
@import "00.4.init";
@import "01.1.html";
When I copy the resulting link to a new tab it shows:
variable @background-dark is undefined on line 24 in file '/Content/00.1.import.less':
[23]: @import "11.1.p";
[24]: @import "13.1.a";
---------------^
[25]: @import "13.2.a-login";
Strange thing is that that line is just that, an import line. That file doesn't make use of any variables or mixins at all. neither does the next file. Currently I'm testing a variable/mixin one single file.
If I hit F5 the next exception I get is:
Value does not fall within the expected range.
Stack Trace:
[ArgumentException: Value does not fall within the expected range.]
System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo) +0
System.Web.Hosting.IIS7WorkerRequest.SetKnownResponseHeader(Int32 index, String value, Boolean replace) +150
System.Web.HttpHeaderCollection.SetHeader(String name, String value, Boolean replace) +219
System.Web.HttpHeaderCollection.Add(String name, String value) +23
System.Web.HttpResponse.AppendHeader(String name, String value) +189
System.Web.HttpResponseWrapper.AppendHeader(String name, String value) +16
dotless.Core.Response.CssResponse.HandleCompression() +646
dotless.Core.Response.CssResponse.WriteCss(String css) +79
dotless.Core.Loggers.AspResponseLogger.Log(String message) +50
dotless.Core.Loggers.Logger.Log(LogLevel level, String message) +80
dotless.Core.Loggers.Logger.Error(String message) +43
dotless.Core.LessEngine.TransformToCss(String source, String fileName) +562
dotless.Core.ParameterDecorator.TransformToCss(String source, String fileName) +420
dotless.Core.HandlerImpl.Execute() +152
dotless.Core.LessCssHttpHandler.ProcessRequest(HttpContext context) +123
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +100
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
Example Variable Problem: declaration
@background-dark: #404040;
usage
div#top
{
height:125px;
border-top: 2px solid #158fa6;
background:@background-dark;
}
This fails no matter what I do.
Anyone know where I'm going wrong?
There seem to be 2 problems.. First off this should be reported to http://github.com/dotless/dotless rather than on stack overflow, but anyway I'll continue.
The caching issue seems to be an exception setting headers - I haven't see that before and it needs investigating to work out what is going wrong.
The variable problem is maybe suffering from a bug we had prior to 1.3.0.5 where it didn't report errors in imported files correctly. If you are not on 1.3.05, please upgrade and try again.