Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error running .Net application after upgrading .Net NuGet 3.0.91 to 3.0.97 #65

Open
jsmitch122 opened this issue Jun 21, 2023 · 4 comments

Comments

@jsmitch122
Copy link

In existing code with method WebOptimizer.IAssetPipeline.AddScssBundle(.... we now get the following error when running.

System.InvalidOperationException: JS engine is not registered.
at Microsoft.Extensions.DependencyInjection.PipelineExtensions.CheckJsEngineRegistration()
at Microsoft.Extensions.DependencyInjection.PipelineExtensions.AddScssBundle(IAssetPipeline pipeline, WebOptimizerScssOptions options, String route, String[] sourceFiles)

@Taritsyn
Copy link
Contributor

Hello!

Since the original library is written in JavaScript, you will need a JS engine to run it. As a JS engine is used the JavaScript Engine Switcher library. First of all, you need to install the JavaScriptEngineSwitcher.Extensions.MsDependencyInjection package which makes registration of JS engines more convenient. Then you need to install one of the NuGet packages containing a JS engine provider:

After installing the packages, you will need to register the default JS engine.

@Taritsyn
Copy link
Contributor

Hello, Peter!

Previously, this library was tightly bound to the JavaScriptEngineSwitcher.V8 module. Now you independently determine which module to use (see the “Making used JavaScript engine configurable” issue).

@ghost
Copy link

ghost commented Mar 15, 2024

Maybe there should be a default JS engine included still, with the ability to replace it if desired? - just to avoid such upgrade exceptions; most would probably expect consistent behaviour during package upgrades.

@Taritsyn
Copy link
Contributor

Default engine is an additional dependency, and not the most lightweight one. Nowadays it is better to avoid additional dependencies.

It is possible that in this case the major version should have been changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants