Closed nhannguyen29 closed 5 years ago
I haven't tested on Mac OS for a while, and don't have a Mac to test this out on at the moment. You probably need to compile VroomJs. See https://github.com/pauldotknopf/vroomjs-core for instructions.
I tried to follow the instruction on how to set up the VroomJs. However, I encountered this error:
svn checkout --force http://gyp.googlecode.com/svn/trunk build/gyp \ --revision 1501 svn: E170013: Unable to connect to a repository at URL 'http://gyp.googlecode.com/svn/trunk' svn: E160013: '/svn/trunk' path not found Makefile:301: recipe for target 'dependencies' failed make: *\ [dependencies] Error 1
Seems like the issue #289 is the same as mine. In that issue, the poster was able to work around this to run the make native ...
command when building v8 but I couldn't. Can you look into this, please? Thank you so much.
It will not compile to Mac since the repository http://gyp.googlecode.com/svn/trunk is not available anymore and I could not make VroomJs compile with gyp version greater than 3.17.
Is it possible to run on Mac using javascript engine other than v8?
Is it possible to run on Mac using javascript engine other than v8?
@fujihara If you are using a .NET Core, then try to install the following packages: JavaScriptEngineSwitcher.ChakraCore and JavaScriptEngineSwitcher.ChakraCore.Native.osx-x64.
Any news on this? It's not really critical for me, but it makes a demo just that bit cooler if it works on macOS too. ;)
After followed the step-by-step instruction on https://github.com/pauldotknopf/vroomjs-core/issues/10, I have successfully built a libVroomJsNative.so, and copy it into /usr/local/lib. That doesn't work. Then I link it to libVroomJsNative.dylib, the application crashed without any information. I have tried to build the React.Core in order to find what happened, the dotnet restore
shows many System packages do not have compatible version on osx-10.12-x64. Finally I dropped my attempt. The .net core just release less a year, and the SDK is still in preview stage. We could not expect it to run anywhere.
I don't know if my PR could be merged. It it could, the VroomJS will be skipped on macOS, then using Chakra instead.
I am facing this issue in Ubuntu 16.04. Is it possible to force React.NET to use another js engine ?
I managed to change the js engine. Now it works with Chakra and Jint, but now I got another problem. It takes so long to process jsx files. Sometimes it takes about 1 minute in one single jsx. The same code in Windows is processed instantly.
As you can see in the print above, it took 47625 ms to process a tiny jsx (0.6 KB)
Any thoughts ?
@luty81 how do you managed the JS engine? could you share the code?
I am switching to JavaScriptService which is written by asp.net core team. It is working well on Windows, Linux and macOS.
@holmescn in Startup.Configure something like this:
var engineSwitcher = JsEngineSwitcher.Instance;
engineSwitcher.DefaultEngineName = "Jint";
engineSwitcher.EngineFactories
.AddChakraCore()
.AddJint()
.AddVroom();
app.UseReact(config =>
{
//
}
The code above along this fix https://github.com/reactjs/React.NET/pull/359 solves the problem for me in Ubuntu 16.04 LTS
Yeah, manually adding EngineFactories
(like @luty81 mentioned above) is the correct method to specify which JS engines to use. ReactJS.NET adds some engine factories by default, but only if you haven't already registered some yourself (see the code at https://github.com/reactjs/React.NET/blob/3ea6f8be627cdc6cf627e588e3dd96a2cb6f1d78/src/React.Core/JavaScriptEngineFactory.cs#L360).
I ran into this tonight on OSX. Thanks to the helpful instructions in this thread and a couple of other places I was able to piece together a working version.
The process is
JavaScriptEngineSwitcher.Jint
packageAdd the namespaces to Startup.cs
using JavaScriptEngineSwitcher.Core;
using JavaScriptEngineSwitcher.ChakraCore;
using JavaScriptEngineSwitcher.Jint;
In the Configure
before the app.UseReact()
call include
var engineSwitcher = JsEngineSwitcher.Instance;
engineSwitcher.DefaultEngineName = "Jint";
engineSwitcher.EngineFactories
.AddJint();
This appears to be sufficient to get everything working, however as @luty81 observed the initial call is very slow. Subsequent calls seem to be fine so it is likely the cost of starting up the JavaScript engine.
This appears to be sufficient to get everything working, however as @luty81 observed the initial call is very slow. Subsequent calls seem to be fine so it is likely the cost of starting up the JavaScript engine.
@stimms, @luty81 Jint is very slow JavaScript engine, because it's written entirely in .NET and works exclusively as interpreter. In your case it is better to use the JavaScriptEngineSwitcher.ChakraCore.
Closing issues older than a year, please re-open if you think this is still relevant.
Hi, I'm using macOS Sierra and ASP.NET Core 1.0 for my website. I encountered this error after adding and configuring React.AspNet 3.0.0 package to my website. Can you help me resolve it? Thank you so much.
Here is the 500 Internal Error I'm getting: