Thanks to visit codestin.com
Credit goes to github.com

Skip to content

React.NET Breaks on NET Core 3.0 Preview 4 #787

Closed
@mbaumanndev

Description

@mbaumanndev

Please verify these steps before filing an issue, and check them off as you go

  • The relevant native JavascriptEngineSwitcher library packages are installed (such as JavaScriptEngineSwitcher.V8.Native.win-x64)
  • The VC++ 2017 runtime is installed
  • The value of SetUseReact and SetUseBabel is correct in ReactConfig.cs or Startup.cs
  • I've looked at the sample projects in this repo to verify that my app is configured correctly

I'm using these library versions:

  • ReactJS.NET: React.AspNet versions 4.1.1 - 4.2.0-beta1 - 5.0.0-alpha1
  • JavaScriptEngineSwitcher: ChakraCore v3.0.9 + win32, win64
  • react and react-dom: react 16.8.4 - react-dom 16.8.4
  • webpack: N/A
  • node: v10.14.1

Runtime environment:

  • OS: Windows 10 Eterprise 1803 x64
  • .NET Framework or .NET Core Version: .NET Core 3.0 Preview 4

Steps to reproduce

  • Start a blank ASP.NET Core 3.0 Preview 4 project
  • Follow the getting started guide for aspnet core : https://reactjs.net/getting-started/aspnetcore.html
  • When starting the app and loading a script handled by React.NET, loading the script (js/jsx/ts/tsx) end in an unhandled exception.

When loading JSX/TSX using React.NET with ASP.NET Core 3 Preview 4, there's an issue with the BabelFileMiddleware instanciation, since the constructor of the StaticFileMiddleware changed between netcore 2 and netcore 3.

Here's a stack trace :

System.MissingMethodException: Method not found: 'Void Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware..ctor(Microsoft.AspNetCore.Http.RequestDelegate, Microsoft.AspNetCore.Hosting.IHostingEnvironment, Microsoft.Extensions.Options.IOptions`1<Microsoft.AspNetCore.Builder.StaticFileOptions>, Microsoft.Extensions.Logging.ILoggerFactory)'.
at React.AspNet.BabelFileMiddleware.CreateFileMiddleware(IBabel babel)
at React.AspNet.BabelFileMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

Since I need this for validating my computer science degree, I'm interested on contributing on this issue, and help to prepare a release wich is compatible with ASP.NET Core 3. Is there any work in progress for netcore 3 ? And, where can I find the sources for ReactJS.NET 5.0.0-alpha1 ? It seems that master only contains sources for 4.2.0-beta1 (and what's the differences between those two versions ?).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions