Parser errors in .less files not being displayed

591 views
Skip to first unread message

John

unread,
May 23, 2012, 9:41:18 AM5/23/12
to DotLess (Less Css for .NET)
I've just upgraded from a semi-ancient version of .less to the latest
version (1.3.0.3) and have noticed a change in the way parser errors
are reported.

Originally if I browsed to a less file and there was an error, I would
get a helpful message pointing me at the exact place where the error
was occurring.

However, now I get one of two things. Initially a big yellow .net
error with this::

Exception type: InvalidOperationException
Exception message: VaryByCustom is already set.
at System.Web.HttpCachePolicy.SetVaryByCustom(String custom)
at System.Web.HttpCachePolicyWrapper.SetVaryByCustom(String custom)
at dotless.Core.Response.CachedCssResponse.WriteCss(String css)
at dotless.Core.HandlerImpl.Execute()
at dotless.Core.LessCssHttpHandler.ProcessRequest(HttpContext
context)
at
System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step,
Boolean& completedSynchronously)


If I then refresh I get a completely blank page.

I'm using this in an Umbraco v4.7.2 site if that makes any
difference. It's a bit of a pain not seeing the detailed error as it
makes tracking bugs completely trial and error.

John

Luke Page

unread,
May 23, 2012, 2:47:17 PM5/23/12
to dot...@googlegroups.com

We have a bug that errors in imported files don't get reported correctly.. maybe its that?

If so I aim to look at it in the next couple of weeks unless noone beats me to it.

--
You received this message because you are subscribed to the Google Groups "DotLess (Less Css for .NET)" group.
To post to this group, send email to dot...@googlegroups.com.
To unsubscribe from this group, send email to dotless+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/dotless?hl=en.

John

unread,
May 24, 2012, 3:21:03 AM5/24/12
to DotLess (Less Css for .NET)
Hi Luke,

That's exactly it - thanks! Sorry, I should have said exactly which
errors I was getting. :)

Much appreciated!

John

On May 23, 7:47 pm, Luke Page <luke.a.p...@gmail.com> wrote:
> We have a bug that errors in imported files don't get reported correctly..
> maybe its that?
>
> If so I aim to look at it in the next couple of weeks unless noone beats me
> to it.
>  On May 23, 2012 3:41 PM, "John" <pdmsjo...@gmail.com> wrote:
>
>
>
>
>
>
>
> > I've just upgraded from a semi-ancient version of .less to the latest
> > version (1.3.0.3) and have noticed a change in the way parser errors
> > are reported.
>
> > Originally if I browsed to a less file and there was an error, I would
> > get a helpful message pointing me at the exact place where the error
> > was occurring.
>
> > However, now I get one of two things.  Initially a big yellow .net
> > error with this::
>
> >    Exception type: InvalidOperationException
> >    Exception message: VaryByCustom is already set.
> >   at System.Web.HttpCachePolicy.SetVaryByCustom(String custom)
> >   at System.Web.HttpCachePolicyWrapper.SetVaryByCustom(String custom)
> >   at dotless.Core.Response.CachedCssResponse.WriteCss(String css)
> >   at dotless.Core.HandlerImpl.Execute()
> >   at dotless.Core.LessCssHttpHandler.ProcessRequest(HttpContext
> > context)
> >   at
>
> > System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplicat­ion.IExecutionStep.Execute()

Luke Page

unread,
Jun 2, 2012, 6:15:52 AM6/2/12
to dot...@googlegroups.com
For those not following github with an eagle eye, this is now fixed in
source and will be included in the next release. From the look of it,
it has been broken for a long time, the design of how errors in
imported files worked and accessing variables from imported files was
conflicting, so I had to change the errors part.

Daniel Hölbling

unread,
Jun 2, 2012, 2:04:33 PM6/2/12
to dot...@googlegroups.com
Great job Luke!

John

unread,
Jun 11, 2012, 3:51:57 AM6/11/12
to DotLess (Less Css for .NET)
That's great - thanks very much!

jo...@johnpapa.net

unread,
Jun 14, 2012, 1:01:44 AM6/14/12
to dot...@googlegroups.com
Has this been fixed and if so, what version is it in?

-- JP
>> > For more options, visit this group at
>> >http://groups.google.com/group/dotless?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups "DotLess (Less Css for .NET)" group.
> To post to this group, send email to dot...@googlegroups.com.
> To unsubscribe from this group, send email to dotless+unsubscribe@googlegroups.com.

Luke Page

unread,
Jun 14, 2012, 2:06:14 AM6/14/12
to dot...@googlegroups.com

Fixed, but not released.

I can do a release if people want it.

To view this discussion on the web visit https://groups.google.com/d/msg/dotless/-/PW5LiIRVM2gJ.

To post to this group, send email to dot...@googlegroups.com.
To unsubscribe from this group, send email to dotless+u...@googlegroups.com.

ruiz.n...@gmail.com

unread,
Jun 14, 2012, 7:59:57 AM6/14/12
to dot...@googlegroups.com
Hi Luke,

Yes, I would like to, if that's possible.

Thanks,

Nicolas.

devm...@hotmail.com

unread,
Jun 15, 2012, 3:57:24 AM6/15/12
to dot...@googlegroups.com
Kindly yes please, i am facing same error.

thanks in advanced.

Luke Page

unread,
Jun 15, 2012, 4:02:27 AM6/15/12
to dot...@googlegroups.com
I will do one in the next couple of days, just want to resolve the
current discussion on embedded resources.
>>>> >> > dotless+u...@googlegroups.com.
>>>> >> > For more options, visit this group at
>>>> >> >http://groups.google.com/group/dotless?hl=en.
>>>> >
>>>> > --
>>>> > You received this message because you are subscribed to the Google
>>>> > Groups "DotLess (Less Css for .NET)" group.
>>>> > To post to this group, send email to dot...@googlegroups.com.
>>>> > To unsubscribe from this group, send email to
>>>> > dotless+u...@googlegroups.com.
>>>> > For more options, visit this group at
>>>> > http://groups.google.com/group/dotless?hl=en.
>>>> >
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "DotLess (Less Css for .NET)" group.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msg/dotless/-/PW5LiIRVM2gJ.
>>> To post to this group, send email to dot...@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> dotless+u...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/dotless?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "DotLess (Less Css for .NET)" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/dotless/-/5EwWD2mTpkQJ.
>
> To post to this group, send email to dot...@googlegroups.com.
> To unsubscribe from this group, send email to
> dotless+u...@googlegroups.com.

Joao Leme

unread,
Jun 19, 2012, 5:15:32 PM6/19/12
to DotLess (Less Css for .NET)
I want it! Where can I find it?

On Jun 14, 3:06 am, Luke Page <luke.a.p...@gmail.com> wrote:
> Fixed, but not released.
>
> I can do a release if people want it.
>  On Jun 14, 2012 6:01 AM, <j...@johnpapa.net> wrote:> Has this been fixed and if so, what version is it in?
>
> > -- JP
>
> > On Saturday, June 2, 2012 6:15:52 AM UTC-4, Luke wrote:
>
> >> For those not following github with an eagle eye, this is now fixed in
> >> source and will be included in the next release. From the look of it,
> >> it has been broken for a long time, the design of how errors in
> >> imported files worked and accessing variables from imported files was
> >> conflicting, so I had to change the errors part.
>
> >> >> >   at System.Web.HttpCachePolicy.**SetVaryByCustom(String custom)
> >> >> >   at System.Web.**HttpCachePolicyWrapper.**SetVaryByCustom(String
> >> custom)
> >> >> >   at dotless.Core.Response.**CachedCssResponse.WriteCss(**String
> >> css)
> >> >> >   at dotless.Core.HandlerImpl.**Execute()
> >> >> >   at dotless.Core.**LessCssHttpHandler.**ProcessRequest(HttpContext
> >> >> > context)
> >> >> >   at
>
> >> >> > System.Web.HttpApplication.**CallHandlerExecutionStep.**
> >> System.Web.HttpApplicat­ion.**IExecutionStep.Execute()
> >> >> >   at System.Web.HttpApplication.**ExecuteStep(IExecutionStep step,
> >> >> > Boolean& completedSynchronously)
>
> >> >> > If I then refresh I get a completely blank page.
>
> >> >> > I'm using this in an Umbraco v4.7.2 site if that makes any
> >> >> > difference.  It's a bit of a pain not seeing the detailed error as
> >> it
> >> >> > makes tracking bugs completely trial and error.
>
> >> >> > John
>
> >> >> > --
> >> >> > You received this message because you are subscribed to the Google
> >> Groups
> >> >> > "DotLess (Less Css for .NET)" group.
> >> >> > To post to this group, send email to dot...@googlegroups.com.
> >> >> > To unsubscribe from this group, send email to
> >> >> > dotless+unsubscribe@**googlegroups.com<dotless%2Bunsu...@googlegroups.com>.
>
> >> >> > For more options, visit this group at
> >> >> >http://groups.google.com/**group/dotless?hl=en<http://groups.google.com/group/dotless?hl=en>.
>
> >> > --
> >> > You received this message because you are subscribed to the Google
> >> Groups "DotLess (Less Css for .NET)" group.
> >> > To post to this group, send email to dot...@googlegroups.com.
> >> > To unsubscribe from this group, send email to dotless+unsubscribe@**
> >> googlegroups.com <dotless%2Bunsu...@googlegroups.com>.
> >> > For more options, visit this group athttp://groups.google.com/**
> >> group/dotless?hl=en <http://groups.google.com/group/dotless?hl=en>.

Luke Page

unread,
Jun 19, 2012, 5:17:43 PM6/19/12
to dot...@googlegroups.com

Latest release on github or nu get.

xavier...@gmail.com

unread,
Aug 14, 2012, 9:30:40 PM8/14/12
to dot...@googlegroups.com
Hi Luke,

I am using 1.3.0.5 and I still see this issue occurring ?

Sometimes I see the 'VaryByCustom' error and sometimes a blank page (from the same code, I saw the VaryByCustom error, then hit F5 and then a blank page, served with a 200 HTTP code).

Luke Page

unread,
Aug 15, 2012, 2:09:33 AM8/15/12
to dot...@googlegroups.com

There is a different bug about sometimes an error causing an exception because vary by is set twice. There is a pull request, but I want it done properly (not just try-catch).

I'm quite busy with less.js at the moment and was thinking of releasing both at the same time.

To view this discussion on the web visit https://groups.google.com/d/msg/dotless/-/6t9tGuSHV0kJ.

xavier...@gmail.com

unread,
Aug 19, 2012, 11:35:35 PM8/19/12
to dot...@googlegroups.com
Thanks for the response, Luke. No worries, just wanted to confirm/report the issue. Thanks for looking into it.
> >> >> > dotless+unsubscribe@**googlegroups.com<dotless%2Bunsubscribe@googlegroups.com>.

taw...@gmail.com

unread,
Sep 19, 2012, 9:35:25 AM9/19/12
to dot...@googlegroups.com, pdms...@gmail.com
Also getting this same error from the latest package on Nuget

VaryByCustom is already set.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.InvalidOperationException: VaryByCustom is already set.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace: 

[InvalidOperationException: VaryByCustom is already set.]
   System.Web.HttpCachePolicy.SetVaryByCustom(String custom) +3175314
   System.Web.HttpCachePolicyWrapper.SetVaryByCustom(String custom) +11
   dotless.Core.Response.CachedCssResponse.WriteCss(String css) +270
   dotless.Core.HandlerImpl.Execute() +167
   dotless.Core.LessCssHttpHandler.ProcessRequest(HttpContext context) +133
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +100
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

Luke Page

unread,
Sep 19, 2012, 9:37:32 AM9/19/12
to dot...@googlegroups.com, pdms...@gmail.com
Fixed in trunk, will be in next release

https://github.com/dotless/dotless/commit/2a1572e208acb861ed362f2b1e3b6e5180779bde

--
You received this message because you are subscribed to the Google Groups "DotLess (Less Css for .NET)" group.
To view this discussion on the web visit https://groups.google.com/d/msg/dotless/-/LHNA5m5kRPAJ.
Reply all
Reply to author
Forward
0 new messages