.less Stack Overflow

Feb 3, 2015 at 11:24 AM
I have a problem, in that I am running a website on Windows Server 2008R2 64 bit. When I try to view a .less file (which imports an old version of Bootstrap), I get a stack overflow error.

I checked the @import statements and there doesn't seem to be a loop involved.

The one thing that did "fix" it was setting the "Enable 32-bit applications" on the application pool to true (default of false)... with no other change in the website, it works.... turn it off, no work.

I'm not entirely happy about this, especially when there doesn't seem to be a reason (on Windows Server 2012 the app pool setting is false, no issues)...

Has anyone else had this error, and is there any hope of finding another solution?

Thanks
Coordinator
Feb 3, 2015 at 11:29 AM
Hello, Puzsol!

What JavaScript engine is used for the BundleTransformer.Less?
Feb 3, 2015 at 9:12 PM
MSIE:
With default IE (8.0.76...) installed (and unloved and unused)

<bundleTransformer xmlns="http://tempuri.org/BundleTransformer.Configuration.xsd">
<core>
  <css>
    <translators>
      <add name="NullTranslator" type="BundleTransformer.Core.Translators.NullTranslator, BundleTransformer.Core" enabled="false" />
      <add name="LessTranslator" type="BundleTransformer.Less.Translators.LessTranslator, BundleTransformer.Less" />
    </translators>
    <postProcessors>
      <add name="UrlRewritingCssPostProcessor" type="BundleTransformer.Core.PostProcessors.UrlRewritingCssPostProcessor, BundleTransformer.Core" useInDebugMode="false" />
    </postProcessors>
    <minifiers>
      <add name="NullMinifier" type="BundleTransformer.Core.Minifiers.NullMinifier, BundleTransformer.Core" />
    </minifiers>
    <fileExtensions>
      <add fileExtension=".css" assetTypeCode="Css" />
      <add fileExtension=".less" assetTypeCode="Less" />
    </fileExtensions>
  </css>
  <js>
    <translators>
      <add name="NullTranslator" type="BundleTransformer.Core.Translators.NullTranslator, BundleTransformer.Core" enabled="false" />
      <add name="TypeScriptTranslator" type="BundleTransformer.TypeScript.Translators.TypeScriptTranslator, BundleTransformer.TypeScript" enabled="true" />
    </translators>
    <minifiers>
      <add name="NullMinifier" type="BundleTransformer.Core.Minifiers.NullMinifier, BundleTransformer.Core" />
    </minifiers>
    <fileExtensions>
      <add fileExtension=".js" assetTypeCode="JavaScript" />
      <add fileExtension=".ts" assetTypeCode="TypeScript" />
    </fileExtensions>
  </js>
</core>
<less useNativeMinification="false" ieCompat="true" strictMath="false" strictUnits="false" dumpLineNumbers="None" javascriptEnabled="true" globalVariables="" modifyVariables="">
  <jsEngine name="MsieJsEngine" />
</less>
<typeScript codeGenTarget="EcmaScript5" noImplicitAny="false" removeComments="false" useDefaultLib="true">
  <jsEngine name="MsieJsEngine" />
</typeScript>
</bundleTransformer>

Error stack trace:
[AssetTranslationException: During translation of LESS-code, readed from the file 'site.less', to CSS-code syntax error has occurred.
See more details:

Error type: Syntax
Message: Out of stack space
File: themes/base/mixins.less
]
BundleTransformer.Less.Translators.LessTranslator.InnerTranslate(IAsset asset, LessCompiler lessCompiler, Boolean enableNativeMinification) +1021
BundleTransformer.Less.Translators.LessTranslator.Translate(IAsset asset) +233
BundleTransformer.Core.HttpHandlers.AssetHandlerBase.InnerTranslateAsset(String translatorName, IAsset asset, ITransformer transformer, Boolean isDebugMode) +186
BundleTransformer.Less.HttpHandlers.LessAssetHandler.TranslateAsset(IAsset asset, ITransformer transformer, Boolean isDebugMode) +45
BundleTransformer.Core.HttpHandlers.AssetHandlerBase.ProcessAsset(String assetVirtualPath, String bundleVirtualPath) +339
BundleTransformer.Core.HttpHandlers.AssetHandlerBase.GetProcessedAssetContent(String assetVirtualPath, String bundleVirtualPath) +334
BundleTransformer.Core.HttpHandlers.AssetHandlerBase.ProcessRequest(HttpContextBase context) +352

[HttpException (0x80004005): During translation of LESS-code, readed from the file 'site.less', to CSS-code syntax error has occurred.
See more details:

Error type: Syntax
Message: Out of stack space
File: themes/base/mixins.less
]
BundleTransformer.Core.HttpHandlers.AssetHandlerBase.ProcessRequest(HttpContextBase context) +1494
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +913
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +165


I did see another post mentioning IE9/ IE10 being a requirement for MSIE script engine... is that all it is? Should I perhaps be using the V8 engine instead?
Thanks for taking a look at this.
Coordinator
Feb 4, 2015 at 6:39 AM
Indeed, for correct working of the MSIE JavaScript Engine it is recommended to install Internet Explorer 9 and above on a server (incidentally it is mentioned in the description of package).

You have two variants:
  1. Install the Internet Explorer 9 and above on the server.
  2. Use a JavaScriptEngineSwitcher.V8 package instead of the JavaScriptEngineSwitcher.Msie package (don't forget to pre-install the Visual C++ Redistributable for Visual Studio 2012 on the server).