I am using BundleTransformer for bundling the css and javascript. This is working fine with my Sitecore 9.3's MVC solution. I just upgraded sitecore to 10.3 and deployed the managed code. There is an runtime error as shown below.
Could not find a factory, that creates an instance of the JavaScript engine with name `ChakraCoreJsEngine`.
Description: An unhandled exception occurred.
Exception Details: JavaScriptEngineSwitcher.Core.JsEngineNotFoundException: Could not find a factory, that creates an instance of the JavaScript engine with name `ChakraCoreJsEngine`.
Source Error:
Line 24: <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
Line 25:
Line 26: @Styles.Render("~/bundles/myProj/css")
Line 27: @Scripts.Render("~/bundles/myProj/vendor")
Line 28: @if (Model != null)
Stack Trace:
[JsEngineNotFoundException: Could not find a factory, that creates an instance of the JavaScript engine with name `ChakraCoreJsEngine`.]
JavaScriptEngineSwitcher.Core.JsEngineSwitcher.CreateEngine(String name) +159
DartSassHost.SassCompiler.InitializeCompiler() +136
DartSassHost.SassCompiler.InnerCompile(String content, Boolean indentedSyntax, String inputPath, String outputPath, String sourceMapPath, CompilationOptions options) +72
DartSassHost.SassCompiler.Compile(String content, String inputPath, String outputPath, String sourceMapPath, CompilationOptions options) +123
BundleTransformer.SassAndScss.Translators.SassAndScssTranslator.InnerTranslate(IAsset asset, SassCompiler sassCompiler, Int32 severity, Boolean enableNativeMinification) +228
[AssetTranslationException: During translation of SCSS code, readed from the file '/Areas/myProj/Assets/stylesheets/main.scss', to CSS code error has occurred.
I am using the below nuget packages and versions
- BundleTransformer.Core 1.10.0.0
- BundleTransformer.SassAndScss 1.13.13.0
- DartSassHost 1.0.7.0
Also my web.config has the below.
<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="SassAndScssTranslator" type="BundleTransformer.SassAndScss.Translators.SassAndScssTranslator, BundleTransformer.SassAndScss" />
</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=".sass" assetTypeCode="Sass" />
<add fileExtension=".scss" assetTypeCode="Scss" />
</fileExtensions>
</css>
<js>
<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" />
</minifiers>
<fileExtensions>
<add fileExtension=".js" assetTypeCode="JavaScript" />
</fileExtensions>
</js>
</core>
<sassAndScss>
<includePaths>
<add path="~/Areas/myProj/Assets/stylesheets/vendor/bootstrap-sass/assets/stylesheets/bootstrap" />
<add path="~/Areas/myProj/Assets/stylesheets/vendor/slick-carousel/slick" />
<add path="~/Areas/myProj/Assets/stylesheets/vendor/font-awesome/scss" />
</includePaths>
<jsEngine name="ChakraCoreJsEngine" />
</sassAndScss>
</bundleTransformer>
So the JSEngine is ChakraCore. Thanks in advance for any ideas/solutions.