unable to configuration postcss
vairamuthuR opened this issue · 11 comments
I have the configure Autoprefixer postprocess file knowing psysical path, it throws below error
I also install JavaScriptEngineSwitcher.Msie (only in the Chakra JsRT modes)
- JavaScriptEngineSwitcher.V8
- JavaScriptEngineSwitcher.ChakraCore
System.Configuration.ConfigurationErrorsException
HResult=0x80131902
Message=In the name
attribute of /configuration/bundleTransformer/autoprefixer/jsEngine
configuration element not specified a name of JS engine.
If you have not installed JS engine, then for correct working of this module is recommended to install one of the following NuGet packages:
- JavaScriptEngineSwitcher.Msie (only in the Chakra JsRT modes)
- JavaScriptEngineSwitcher.V8
- JavaScriptEngineSwitcher.ChakraCore
After package is installed and JS engine is registered (https://github.com/Taritsyn/JavaScriptEngineSwitcher/wiki/Registration-of-JS-engines), need set a name of JS engine (for example, MsieJsEngine
) to the name
attribute of /configuration/bundleTransformer/autoprefixer/jsEngine
configuration element.
Source=BundleTransformer.Autoprefixer
StackTrace:
at BundleTransformer.Autoprefixer.PostProcessors.AutoprefixCssPostProcessor..ctor(Func1 createJsEngineInstance, IVirtualFileSystemWrapper virtualFileSystemWrapper, AutoprefixerSettings autoprefixerConfig) at BundleTransformer.Autoprefixer.PostProcessors.AutoprefixCssPostProcessor..ctor() at ThemeStudio.Controllers.HomeController.export(ThemeProperties exporting) in D:\workspace\old laptop\updated\ThemeStudio\Controllers\HomeController.cs:line 253 at System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary
2 parameters)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary2 parameters) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult
2.CallEndDelegate(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.b__3d()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.b__3f()
could you please help me how to configure Autoprefixer in MVC application
Hello!
You need to install a JS engine and configure it. In the error message describes the entire process. Just in case, I give a link to the module documentation.
Hi Taritsyn,
Thanks for your reply
Bundler Transformer Autoprefixer postprocess file knowing psysical path
have a project in ASP.NET MVC and I want to use Bundler Transformer Autoprefixer to process my css files. My use case is a little bit unusual and I need to process css content from physical path like "d:\somewhere\style.css". I think I can use AutoprefixCssPostProcessor class to do so, but it allows to process assets, that require virtual path to the file. Is it possible to postprocess such file using AutoprefixCssPostProcessor?
please refer the code snippet for web.config file
My use case is a little bit unusual and I need to process css content from physical path like "d:\somewhere\style.css".
This feature is not supported.
please refer the code snippet for web.config file
I recommend to see a example project.
Hi Taritsyn,
How can I achieved the physical path for css file, if any alternative here? if possible to pass the css content to autoprefixer, please share the example ?
I already wrote that this feature is not supported. In your case, I recommend experimenting with running of the Node.js modules by using the Edge.js library.
Hi Taritsyn,
My application not node based application, it pure MVC application, we use scss file , to compiler scss file to help libsass nuget, we need add the autoprefixer for that css, how can achieve this requirement
Hello!
Try to use the Autoprefixer Host library.
Hi Taritsyn,
Thanks for your reply, I'm try this, but it throws below error
AutoprefixerHost.AutoprefixerLoadException
HResult=0x80131500
Message=During loading of the Autoprefixer error has occurred. Failed to create instance of the ChakraCoreJsEngine. Most likely it happened, because the 'ChakraCore.dll' assembly or one of its dependencies was not found. Try to install the JavaScriptEngineSwitcher.ChakraCore.Native.win-x86 package via NuGet. In addition, you still need to install the Microsoft Visual C++ Redistributable for Visual Studio 2017 (https://www.visualstudio.com/downloads/#microsoft-visual-c-redistributable-for-visual-studio-2017).
Source=AutoprefixerHost
StackTrace:
at AutoprefixerHost.Autoprefixer..ctor(IJsEngineFactory jsEngineFactory, ProcessingOptions options)
at ThemeStudio.Controllers.HomeController.export(ThemeProperties exporting) in D:\workspace\old laptop\updated\ThemeStudio\Controllers\HomeController.cs:line 264
at System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters)
at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary2 parameters) at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary
2 parameters)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult2.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase
1.End()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.b__3d()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.b__3f()
Inner Exception 1:
JsEngineLoadException: Failed to create instance of the ChakraCoreJsEngine. Most likely it happened, because the 'ChakraCore.dll' assembly or one of its dependencies was not found. Try to install the JavaScriptEngineSwitcher.ChakraCore.Native.win-x86 package via NuGet. In addition, you still need to install the Microsoft Visual C++ Redistributable for Visual Studio 2017 (https://www.visualstudio.com/downloads/#microsoft-visual-c-redistributable-for-visual-studio-2017).
Inner Exception 2:
DllNotFoundException: Unable to load DLL 'ChakraCore': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
There is a hint in the error message:
Try to install the JavaScriptEngineSwitcher.ChakraCore.Native.win-x86 package via NuGet. In addition, you still need to install the Microsoft Visual C++ Redistributable for Visual Studio 2017 (https://www.visualstudio.com/downloads/#microsoft-visual-c-redistributable-for-visual-studio-2017).
Also, JavaScriptEngineSwitcher.ChakraCore and JavaScriptEngineSwitcher.ChakraCore.Native.win-x86 packages must have a version 3.1.1.