Skip to content

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

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
4 tasks done
mbaumanndev opened this issue Apr 26, 2019 · 6 comments
Closed
4 tasks done

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

mbaumanndev opened this issue Apr 26, 2019 · 6 comments
Milestone

Comments

@mbaumanndev
Copy link

mbaumanndev commented Apr 26, 2019

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 ?).

@dustinsoftware
Copy link
Member

What's on the master branch is the alpha build, I forgot to push the bump to build.proj :) if you try and build this project against the ASP.NET Core 3 preview SDK you should see a build error for React.AspNet.

I suspect the ctor breaking change is caused by dotnet/aspnetcore#7725

If that is indeed the case, we'll need to ship compile different DLLs for .NET Core 2.x and 3.x.

Feel free to send a PR but it will probably also need some changes to the build pipeline :) I have a little time to kill right now so I'll take a look.

@dustinsoftware dustinsoftware added this to the 5.0 milestone Apr 29, 2019
@mbaumanndev
Copy link
Author

I'll try to send a PR in the next few weeks :)

Do you have a Slack or anything like this if I have any questions when I work on this, or should I ask my questions here in the comments ?

For the different DLLs to ship, my first thoughts are that we may need to target netstandard2.1 (with compiler directives) especially for ASP.NET Core 3, since it will run on that platform if I did get all the annoucements, I'll take a closer look on that in the next few days.

@dustinsoftware
Copy link
Member

dustinsoftware commented Apr 29, 2019 via email

@dustinsoftware
Copy link
Member

A WIP branch is available in #791. CI won’t pass until appveyor supports the 3.0 sdk which is in preview right now.

@Daniel15
Copy link
Member

I think we can close this now that #791 is done?

@dustinsoftware
Copy link
Member

Yep!

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

3 participants