This project has moved. For the latest updates, please go here.

AutoPrefixer Error w/ MSIEJSEngine (IEv9.0.8112.16421)

Feb 27, 2015 at 6:16 PM
Hello,

I'm receiving the below error with BundleTransformer.AutoPrefixer, using the MsieJsEngine and with IE v9.0.8112.16421 installed on the server. BundleTransformer.Less works fine with the same JS engine. Any insight? Updating IE is probably not possible given its a large corporate network.
During postprocessing of CSS-code, readed from the file '/Content/LESS/Bundled.less', by Autoprefix CSS-postprocessor error has occurred.   
See more details:

Object doesn't support property or method 'defineProperty'
 

BundleTransformer.Core.PostProcessors.AssetPostProcessingException: During postprocessing of CSS-code, readed from the file '/Content/LESS/Bundled.less', by Autoprefix CSS-postprocessor error has occurred.   
See more details:

Object doesn't support property or method 'defineProperty' ---> JavaScriptEngineSwitcher.Core.JsRuntimeException: Object doesn't support property or method 'defineProperty' ---> MsieJavaScriptEngine.JsRuntimeException: Object doesn't support property or method 'defineProperty'
   at MsieJavaScriptEngine.ActiveScript.ActiveScriptJsEngineBase.InvokeScript(Action action)
   at MsieJavaScriptEngine.ActiveScript.ActiveScriptJsEngineBase.Execute(String code)
   at MsieJavaScriptEngine.MsieJsEngine.Execute(String code)
   at JavaScriptEngineSwitcher.Msie.MsieJsEngine.InnerExecute(String code)
   --- End of inner exception stack trace ---
   at JavaScriptEngineSwitcher.Msie.MsieJsEngine.InnerExecute(String code)
   at JavaScriptEngineSwitcher.Core.JsEngineBase.Execute(String code)
   at JavaScriptEngineSwitcher.Core.JsEngineBase.ExecuteResource(String resourceName, Type type)
   at BundleTransformer.Autoprefixer.AutoPrefixers.CssAutoprefixer.Initialize()
   at BundleTransformer.Autoprefixer.AutoPrefixers.CssAutoprefixer.Process(String content, String path, AutoprefixingOptions options)
   at BundleTransformer.Autoprefixer.PostProcessors.AutoprefixCssPostProcessor.InnerPostProcess(IAsset asset, CssAutoprefixer cssAutoprefixer)
   --- End of inner exception stack trace ---
   at BundleTransformer.Autoprefixer.PostProcessors.AutoprefixCssPostProcessor.InnerPostProcess(IAsset asset, CssAutoprefixer cssAutoprefixer)
   at BundleTransformer.Autoprefixer.PostProcessors.AutoprefixCssPostProcessor.PostProcess(IList`1 assets)
   at BundleTransformer.Core.Transformers.TransformerBase.PostProcess(IList`1 assets, Boolean isDebugMode)
   at BundleTransformer.Core.Transformers.TransformerBase.Transform(IList`1 assets, BundleContext bundleContext, BundleResponse bundleResponse, VirtualPathProvider virtualPathProvider, Boolean isDebugMode)
   at BundleTransformer.Core.Transformers.TransformerBase.Process(BundleContext bundleContext, BundleResponse bundleResponse, Boolean isDebugMode)
   at BundleTransformer.Core.Transformers.TransformerBase.Process(BundleContext bundleContext, BundleResponse bundleResponse)
   at System.Web.Optimization.Bundle.ApplyTransforms(BundleContext context, String bundleContent, IEnumerable`1 bundleFiles)
   at System.Web.Optimization.Bundle.GenerateBundleResponse(BundleContext context)
   at System.Web.Optimization.Bundle.GetBundleResponse(BundleContext context)
   at System.Web.Optimization.BundleResolver.GetBundleContents(String virtualPath)
   at System.Web.Optimization.AssetManager.EliminateDuplicatesAndResolveUrls(IEnumerable`1 refs)
   at System.Web.Optimization.AssetManager.DeterminePathsToRender(IEnumerable`1 assets)
   at System.Web.Optimization.AssetManager.RenderExplicit(String tagFormat, String[] paths)
   at System.Web.Optimization.Styles.RenderFormat(String tagFormat, String[] paths)
   at System.Web.Optimization.Styles.Render(String[] paths)
   at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
   at System.Web.Mvc.WebViewPage.ExecutePageHierarchy()
   at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
   at System.Web.WebPages.WebPageBase.<>c__DisplayClass3.<RenderPageCore>b__2(TextWriter writer)
   at System.Web.WebPages.HelperResult.WriteTo(TextWriter writer)
   at System.Web.WebPages.WebPageBase.Write(HelperResult result)
   at System.Web.WebPages.WebPageBase.RenderSurrounding(String partialViewName, Action`1 body)
   at System.Web.WebPages.WebPageBase.PopContext()
   at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
   at System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance)
   at System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer)
   at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult)
   at System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End()
   at System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult)
   at System.Web.Mvc.Controller.<BeginExecute>b__15(IAsyncResult asyncResult, Controller controller)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End()
   at System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult)
   at System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult)
   at System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End()
   at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult)
   at System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Coordinator
Feb 28, 2015 at 7:35 AM
Hello, Cgrady17!

In documentation and description of package is written:
For correct working of this module is recommended to install the following NuGet packages: JavaScriptEngineSwitcher.V8 or JavaScriptEngineSwitcher.Msie (only in the ChakraJsRt mode).
What is the ChakraJsRt mode you can read in the documentation of MSIE JavaScript Engine:
ChakraJsRt . JsRT version of Chakra JavaScript engine (supports ECMAScript 5). Requires Internet Explorer 11 or higher on the machine. Detailed information about JsRT you can read in the Paul Vick's blog.
I recommend you to install a JavaScriptEngineSwitcher.V8 package.
Mar 2, 2015 at 5:03 PM
Thank you for the quick reply Taritsyn! I tried switching to JavaScriptEngineSwitcher.V8, however I get a generic 500 error when trying to run the application. I do have both "msvcp110.dll" and "msvcr110.dll" installed on my system, so that shouldn't be the problem. The error happens whether I have the V8 engine used for anything or not, just having it installed causes the error. Unfortunately, this error is happening at the earliest level of IIS, so I have no application logs that my help identify the error. I have attached below a snapshot of my Web.config if that helps:
  <bundleTransformer xmlns="http://tempuri.org/BundleTransformer.Configuration.xsd">
    <core>
      <css defaultMinifier="MicrosoftAjaxCssMinifier">
        <translators>

          <add name="NullTranslator" type="BundleTransformer.Core.Translators.NullTranslator, BundleTransformer.Core" enabled="false" />

          <add name="LessTranslator" type="BundleTransformer.Less.Translators.LessTranslator, BundleTransformer.Less" />
        </translators>

        <fileExtensions>
          <add fileExtension=".css" assetTypeCode="Css" />

          <add fileExtension=".less" assetTypeCode="Less" />
        </fileExtensions>
        <postProcessors>
          <add name="UrlRewritingCssPostProcessor" type="BundleTransformer.Core.PostProcessors.UrlRewritingCssPostProcessor, BundleTransformer.Core" useInDebugMode="false" />

          <add name="AutoprefixCssPostProcessor" type="BundleTransformer.Autoprefixer.PostProcessors.AutoprefixCssPostProcessor, BundleTransformer.Autoprefixer" useInDebugMode="true" />
        </postProcessors>
        <minifiers>
          <add name="NullMinifier" type="BundleTransformer.Core.Minifiers.NullMinifier, BundleTransformer.Core" />
          <add name="MicrosoftAjaxCssMinifier" type="BundleTransformer.MicrosoftAjax.Minifiers.MicrosoftAjaxCssMinifier, BundleTransformer.MicrosoftAjax" />
        </minifiers>
      </css>

      <js defaultMinifier="MicrosoftAjaxJsMinifier">
        <translators>
          <add name="NullTranslator" type="BundleTransformer.Core.Translators.NullTranslator, BundleTransformer.Core" enabled="false" />
        </translators>
        <minifiers>
          <add name="NullMinifier" type="BundleTransformer.Core.Minifiers.NullMinifier, BundleTransformer.Core" />
          <add name="MicrosoftAjaxJsMinifier" type="BundleTransformer.MicrosoftAjax.Minifiers.MicrosoftAjaxJsMinifier, BundleTransformer.MicrosoftAjax" />
        </minifiers>
        <fileExtensions>
          <add fileExtension=".js" assetTypeCode="JavaScript" />
        </fileExtensions>
      </js>
    </core>
    <less>
      <jsEngine name="MsieJsEngine" />
    </less>

    <autoprefixer>
      <jsEngine name="MsieJsEngine" />
    </autoprefixer>
  </bundleTransformer>
  <jsEngineSwitcher xmlns="http://tempuri.org/JavaScriptEngineSwitcher.Configuration.xsd">

    <core>
      <engines>
        <add name="MsieJsEngine" type="JavaScriptEngineSwitcher.Msie.MsieJsEngine, JavaScriptEngineSwitcher.Msie" />
      <add name="V8JsEngine" type="JavaScriptEngineSwitcher.V8.V8JsEngine, JavaScriptEngineSwitcher.V8" /></engines>
    </core>
  </jsEngineSwitcher>
Coordinator
Mar 2, 2015 at 5:11 PM
You have installed the engine, but did not plug it:
<bundleTransformer xmlns="http://tempuri.org/BundleTransformer.Configuration.xsd">
    ...
    <autoprefixer>
        <jsEngine name="MsieJsEngine" />
    </autoprefixer>
</bundleTransformer>
Should be like this:
<bundleTransformer xmlns="http://tempuri.org/BundleTransformer.Configuration.xsd">
    ...
    <autoprefixer>
        <jsEngine name="V8JsEngine" />
    </autoprefixer>
</bundleTransformer>
Mar 2, 2015 at 10:14 PM
Hello Taritsyn,

I did try that, however I still get an IIS 500 Error. I even tried removing MsieJsEngine from the project, but that didn't help either. The error is immediate, happening before the application even loads.
<less>
      <jsEngine name="V8JsEngine" />
    </less>

    <autoprefixer>
      <jsEngine name="V8JsEngine" />
    </autoprefixer>
Coordinator
Mar 3, 2015 at 6:06 AM
Describe error in more detail.
Mar 3, 2015 at 1:48 PM
Checking the IIS logs files, I found the error to be 500.19, which is "Configuration data is invalid." I've posted below part of my Web.config again:
  <bundleTransformer xmlns="http://tempuri.org/BundleTransformer.Configuration.xsd">
    <core>
      <css defaultMinifier="MicrosoftAjaxCssMinifier">
        <translators>

          <add name="NullTranslator" type="BundleTransformer.Core.Translators.NullTranslator, BundleTransformer.Core" enabled="false" />

          <add name="LessTranslator" type="BundleTransformer.Less.Translators.LessTranslator, BundleTransformer.Less" />
        </translators>

        <fileExtensions>
          <add fileExtension=".css" assetTypeCode="Css" />

          <add fileExtension=".less" assetTypeCode="Less" />
        </fileExtensions>
        <postProcessors>
          <add name="UrlRewritingCssPostProcessor" type="BundleTransformer.Core.PostProcessors.UrlRewritingCssPostProcessor, BundleTransformer.Core" useInDebugMode="false" />

          <add name="AutoprefixCssPostProcessor" type="BundleTransformer.Autoprefixer.PostProcessors.AutoprefixCssPostProcessor, BundleTransformer.Autoprefixer" useInDebugMode="true" />
        </postProcessors>
        <minifiers>
          <add name="NullMinifier" type="BundleTransformer.Core.Minifiers.NullMinifier, BundleTransformer.Core" />
          <add name="MicrosoftAjaxCssMinifier" type="BundleTransformer.MicrosoftAjax.Minifiers.MicrosoftAjaxCssMinifier, BundleTransformer.MicrosoftAjax" />
        </minifiers>
      </css>

      <js defaultMinifier="MicrosoftAjaxJsMinifier">
        <translators>
          <add name="NullTranslator" type="BundleTransformer.Core.Translators.NullTranslator, BundleTransformer.Core" enabled="false" />
        </translators>
        <minifiers>
          <add name="NullMinifier" type="BundleTransformer.Core.Minifiers.NullMinifier, BundleTransformer.Core" />
          <add name="MicrosoftAjaxJsMinifier" type="BundleTransformer.MicrosoftAjax.Minifiers.MicrosoftAjaxJsMinifier, BundleTransformer.MicrosoftAjax" />
        </minifiers>
        <fileExtensions>
          <add fileExtension=".js" assetTypeCode="JavaScript" />
        </fileExtensions>
      </js>
    </core>
    <less>
      <jsEngine name="V8JsEngine" />
    </less>

    <autoprefixer>
      <jsEngine name="V8JsEngine" />
    </autoprefixer>
  </bundleTransformer>
  <jsEngineSwitcher xmlns="http://tempuri.org/JavaScriptEngineSwitcher.Configuration.xsd">

    <core>
      <engines>
        
      <add name="V8JsEngine" type="JavaScriptEngineSwitcher.V8.V8JsEngine, JavaScriptEngineSwitcher.V8" /></engines>
    </core>
  </jsEngineSwitcher>
Coordinator
Mar 3, 2015 at 1:59 PM
Where did you get that this is a Bundle Transformer configuration error? This can be any error in the Web.config file.

If you want to continue this discussion, then attach the full Web.config file.
Mar 3, 2015 at 2:14 PM
Solved it! It was a duplication of the "requestFiltering" field in the Web.config. I had already specified that element, but V8 added its own as well. Thanks for you help Taritsyn!