Skip to content

ReactJS.NET has not been initialised correctly on Azure Web app #191

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
chadangerer opened this issue Nov 11, 2015 · 4 comments
Closed

ReactJS.NET has not been initialised correctly on Azure Web app #191

chadangerer opened this issue Nov 11, 2015 · 4 comments

Comments

@chadangerer
Copy link

I have an existing MVC website and am starting to convert some of the UI to react components. Locally everything is working fine.

When I deployed to azure I got the error message
ReactJS.NET has not been initialised correctly.;StackTrace: at React.Web.Mvc.HtmlHelperExtensions.get_Environment() at React.Web.Mvc.HtmlHelperExtensions.ReactInitJavaScript(HtmlHelper htmlHelper)

I am pretty much following the sample line for line.

I am using webpack to create a server and client bundle. Both are deployed.

My ReactConfig looks like this

ReactSiteConfiguration.Configuration.SetReuseJavaScriptEngines(false).SetLoadBabel(false) .AddScriptWithoutTransform("~/Scripts/build/server.bundle.js");

And this is added to my _DefaultLayout.cshtml.

@Html.ReactInitJavaScript()

Are there known issues with certain versions in Azure?

@Daniel15
Copy link
Member

Which version of ASP.NET MVC are you using? What version of .NET are you using in Azure?

@chadangerer
Copy link
Author

MVC 5 and .NET 4.6

@chadangerer
Copy link
Author

Interestingly enough, I originally had the React.Owin package installed and wasn't using it. I removed it via nuget redeployed and Reactjs.Net seems to be working properly on Azure now. Any thoughts on that?

@Daniel15
Copy link
Member

Interesting, I'm not sure why the React.Owin package would cause that. Anyways, it sounds like it's fixed after uninstalling React.Owin, so I'm going to close this issue. I'll try to figure out why the OWIN package results in issues like this.

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