Comments (4)
We are not using the JavaScript Engine Switcher directly our self, only configuring it. It is being used by LigerShark.WebOptimizer.Sass (or more precisely, one of its dependencies).
Thanks for information! I have an idea how to prevent this error.
from javascriptengineswitcher.
Hello, Ville!
I tried to solve this problem in JavaScript Engine Switcher 3.24.0 and WebOptimizer.Sass 3.0.115. You need to add the following setting to the Startup.cs
file:
…
public void ConfigureServices(IServiceCollection services)
{
…
// Registration of JS engines
services.AddJsEngineSwitcher(options =>
{
options.AllowCurrentProperty = false;
options.DefaultEngineName = JintJsEngine.EngineName;
})
.AddJint()
;
…
In this case, AllowCurrentProperty
property forbid access to the JsEngineSwitcher.Current
property, and thus all work is done through standard ASP.NET Core DI.
from javascriptengineswitcher.
Hello, Ville!
It is assumed that registration of engines in the JavaScript Engine Switcher is performed only once at start of the application (for example, in regular tests I use a special initializer). Under normal conditions, methods of the Startup
class are also called only once when the application starts. Perhaps this behavior changes when using a WebApplicationFactory and because of this the error occurs.
Internally, registration of engines in the JavaScript Engine Switcher is based not on the IServiceCollection
interface, but on the JsEngineSwitcher.Current
property. In fact, JavaScript Engine Switcher is a global variable. This implementation is due to the fact that this library was created before appeared .NET Core and is still used in a large number of projects written in .NET Framework.
Are you directly using a JavaScript Engine Switcher or using some library that uses it as a dependency?
from javascriptengineswitcher.
We are not using the JavaScript Engine Switcher directly our self, only configuring it. It is being used by LigerShark.WebOptimizer.Sass (or more precisely, one of its dependencies).
Now that I think about it, we do not need to compile the sass in our tests and thus there should not be any need to configure JavaScript Engine Switcher in tests.
I'm closing this issue as this is not common/supported case and there are many easy ways to circumvent the problem.
Thanks for all the work you do with this library!
from javascriptengineswitcher.
Related Issues (20)
- Node Stream HOT 2
- Could not load file or assembly 'file:///D:\home\site\wwwroot\bin\ClearScriptV8.win-x64.dll' or one of its dependencies. Could not find or load a specific file. HOT 10
- Resources should conform to correct ICU standard for naming HOT 4
- Jering.Javascript.NodeJS JsCompilationException on spawn identifier HOT 1
- load modules HOT 2
- Request to support Deno HOT 8
- Any way to debug js or capture console output? HOT 3
- ValidationHelpers.CheckNameFormat preventing nested property access HOT 1
- [Q&A] How to pass stdio to nodejs HOT 5
- deprecated? HOT 4
- Issues after updating BundleTransformer packages in ASP.NET MVC project HOT 11
- JavaScriptEngineSwitcher.Core.JsEngineNotFoundException HOT 9
- Checks whether supports a .NET type by Switcher is not appropriate HOT 2
- Warning NETSDK1187 HOT 2
- ES 6 Support? HOT 5
- How to pass c# objects to JavaScript functions? HOT 2
- RangeError: Internal error. Icu error. HOT 3
- Out of Memory Error HOT 9
- JavascriptEngineSwitcher.ChakraCore can't find JavaScriptEngineSwitcher.ChakraCore.Native.linux-x64 in Docker container HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from javascriptengineswitcher.