I have an ASP.Net MVC application which compiles .less files into CSS. In a particular scenario if I hit my endpoint
http:///Account/ResetPassword?t=eyJ0eXAiOiJKV1Qi...
the query string results in a .less compilation warning
directive block with unrecognised format on line 1 in file '~/Content/packageForm.less': []: /beginning of file [1]: @t: eyJ0eXAiOiJKV1Qi...;
^ [2]: @import "setup.less"; directive block with unrecognised format on line 1 in file '~/Content/packageForm.less': []: /beginning of file [1]: @t: eyJ0eXAiOiJKV1Qi...;
^ [2]: @import "setup.less"; directive block with unrecognised format on line 1 in file '~/Content/IE.less': []: /beginning of file [1]: @t: eyJ0eXAiOiJKV1Qi...;
^ [2]: #notes{ directive block with unrecognised format on line 1 in file '~/Content/IE.less': []: /beginning of file [1]: @t: eyJ0eXAiOiJKV1Qi...;
^ [2]: #notes{
If I remove the query string parameter 't' then no compilation errors occur.
Does anyone have a solution?
Thanks,
Paul.
The issue occurs due to a possible bug in dotless WebOptimization Adapter.
To workaround the issue, please add disableParameters="true" to dotless configuration section in your Web.config as shown below:
<dotless minifyCss="false" cache="true" web="true" disableParameters="true" />
I just solved the problem by updating dotless
and dotless adapterfor System.Web.Optimization
to their last available versions:
dotless
: new version 1.5.0dotless adapterfor System.Web.Optimization
: new version 1.3.3For history on this problem, and the resolution, see the GitHub issue "Empty CSS generation at startup" and the related pull request that fixed it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With