Skip to content

ReactEngineNotFoundException on Azure #400

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

Closed
andpoulsen opened this issue Apr 20, 2017 · 7 comments
Closed

ReactEngineNotFoundException on Azure #400

andpoulsen opened this issue Apr 20, 2017 · 7 comments

Comments

@andpoulsen
Copy link

I'm building an asp.net mvc core application with server side rendering and I get ReactEngineNotFoundException, when I deploy to Azure.
You might see the entire callstack yourself here: http://dotnetopeniddemo.azurewebsites.net
I have created an Azure web app, and I'm deploying to it from Visual Studio. It works locally in IIS Express, but not on Azure.

@jordan-yee
Copy link

I'm running into the same issue. My .NET Core 1.1 web application works locally, but throws an exception when published:

ReactEngineNotFoundException: No usable JavaScript engine was found. Please install a JavaScript engine such as React.JavaScriptEngine.ClearScriptV8 (on Windows) or React.JavaScriptEngine.VroomJs (on Linux and Mac OS X). Refer to the ReactJS.NET documentation for more details.

Since it seems to be an issue with the JavaScript engine, I thought adding .DisableServerSideRendering() to app.UseReact(config => { }) might be a work around, but the exception occurs with or without server side rendering.

I think we may need to do something along the lines of this article, but the last few steps are outdated: http://www.samulihaverinen.com/web-development/dotnet/2016/01/19/how-to-run-clearscript-v8-javascript-engine-in-azure/

@jordan-yee
Copy link

jordan-yee commented Apr 27, 2017

I was able to get the application working when published to Azure using a combination of these guides:
http://www.samulihaverinen.com/web-development/dotnet/2016/01/19/how-to-run-clearscript-v8-javascript-engine-in-azure/
https://github.com/Taritsyn/JavaScriptEngineSwitcher/wiki/Registration-of-JS-engines

From the first guide, I installed dependencies separately:
Uninstall-Package React.AspNet
Install-Package JavaScriptEngineSwitcher.Core
Install-Package JavaScriptEngineSwitcher.Msie (May not be needed)
Install-Package JSPool
Install-Package JavaScriptEngineSwitcher.ChakraCore
Install-Package JavaScriptEngineSwitcher.ChakraCore.Native.win-x64 (Selected native implementation)
Install-Package Microsoft.ChakraCore (I think this is key to enabling ChakraCore on the server)
Install-Package React.AspNet -IgnoreDependencies

From the second guide, I installed a package to enable JavaScriptEngineSwitcher configuration in .NET Core 1.X:
Install-Package JavaScriptEngineSwitcher.Extensions.MsDependencyInjection

In Startup.cs ConfigureServices():
services.AddJsEngineSwitcher(options => options.DefaultEngineName = ChakraCoreJsEngine.EngineName).AddChakraCore();

@Taritsyn
Copy link
Contributor

Install-Package Microsoft.ChakraCore

@jyee117 This package is not needed. I recommend you to read the documentation.

@Taritsyn
Copy link
Contributor

@andpoulsen @jyee117 I recommend to read the “Misconceptions about the JavaScript Engine Switcher version 2.X” post.

@andrewwang1tw
Copy link

I was able to get the application working when published to Azure using a combination of these guides:
http://www.samulihaverinen.com/web-development/dotnet/2016/01/19/how-to-run-clearscript-v8-javascript-engine-in-azure/
https://github.com/Taritsyn/JavaScriptEngineSwitcher/wiki/Registration-of-JS-engines

From the first guide, I installed dependencies separately:
Uninstall-Package React.AspNet
Install-Package JavaScriptEngineSwitcher.Core
Install-Package JavaScriptEngineSwitcher.Msie (May not be needed)
Install-Package JSPool
Install-Package JavaScriptEngineSwitcher.ChakraCore
Install-Package JavaScriptEngineSwitcher.ChakraCore.Native.win-x64 (Selected native implementation)
Install-Package Microsoft.ChakraCore (I think this is key to enabling ChakraCore on the server)
Install-Package React.AspNet -IgnoreDependencies

From the second guide, I installed a package to enable JavaScriptEngineSwitcher configuration in .NET Core 1.X:
Install-Package JavaScriptEngineSwitcher.Extensions.MsDependencyInjection

In Startup.cs ConfigureServices():
services.AddJsEngineSwitcher(options => options.DefaultEngineName = ChakraCoreJsEngine.EngineName).AddChakraCore();

This save me, thanks.

@Taritsyn
Copy link
Contributor

Install-Package Microsoft.ChakraCore (I think this is key to enabling ChakraCore on the server)

@andrewwang1tw I recommend you to read the “ChakraCore” section of “Misconceptions about the JavaScript Engine Switcher version 2.X” discussion.

@dustinsoftware
Copy link
Member

Closing issues older than a year, please re-open if you think this is still relevant.

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

5 participants