Skip to content
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

New Service Fabric ASP.NET Core React application does not run #35458

Closed
huwjeffries opened this issue Aug 18, 2021 · 5 comments
Closed

New Service Fabric ASP.NET Core React application does not run #35458

huwjeffries opened this issue Aug 18, 2021 · 5 comments
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates feature-spa
Milestone

Comments

@huwjeffries
Copy link

huwjeffries commented Aug 18, 2021

VS2019 version: 16.11.1
Node version: 14.17.5
NPM version: 6.14.14
Service Fabric SDK: 5.1.321.9590 (latest at time of writing)

Steps to re-create the issue:

Launch Visual Studio 2019 and click "Create New Project"
Select "Service Fabric Application" and click "Next"
On the next screen select .NET Framework 4.8 and click the "Create" button
image
On the next screen select "Stateless ASP.NET Core" and click the "Create" button.
A popup will appear asking which type of ASP.NET core app you'd like to create. Select "ASP.NET Core with React.js".
image
Click the "Create" button.

[If you've installed the service fabric SDK for the first time, find the icon for it in the system tray, right click on it and setup a 1 node cluster - takes a few minutes to become ready.].

After the project has been created and your local service fabric cluster has started, click the "Start" button in Visual Studio (or press F5) to launch the project.

After a lengthy pause, a browser window will open showing the following error:
image

The text of this error is as follows:

`An unhandled exception occurred while processing the request.
AggregateException: One or more errors occurred. (One or more errors occurred. (The npm script 'start' exited without indicating that the create-react-app server was listening for requests. The error output was: Error: EPERM: operation not permitted, mkdir 'C:\WINDOWS\system32\config\systemprofile\AppData\Roaming\npm'

Error: EPERM: operation not permitted, mkdir 'C:\WINDOWS\system32\config\systemprofile\AppData\Roaming\npm'

))
System.Threading.Tasks.Task.GetResultCore(bool waitCompletionNotification)

InvalidOperationException: The npm script 'start' exited without indicating that the create-react-app server was listening for requests. The error output was: Error: EPERM: operation not permitted, mkdir 'C:\WINDOWS\system32\config\systemprofile\AppData\Roaming\npm'

Error: EPERM: operation not permitted, mkdir 'C:\WINDOWS\system32\config\systemprofile\AppData\Roaming\npm'

Microsoft.AspNetCore.SpaServices.ReactDevelopmentServer.ReactDevelopmentServerMiddleware.StartCreateReactAppServerAsync(string sourcePath, string scriptName, string pkgManagerCommand, int portNumber, ILogger logger, DiagnosticSource diagnosticSource, CancellationToken applicationStoppingToken)

Stack Query Cookies Headers Routing
AggregateException: One or more errors occurred. (One or more errors occurred. (The npm script 'start' exited without indicating that the create-react-app server was listening for requests. The error output was: Error: EPERM: operation not permitted, mkdir 'C:\WINDOWS\system32\config\systemprofile\AppData\Roaming\npm' Error: EPERM: operation not permitted, mkdir 'C:\WINDOWS\system32\config\systemprofile\AppData\Roaming\npm' ))
System.Threading.Tasks.Task.GetResultCore(bool waitCompletionNotification)
System.Threading.Tasks.Task.get_Result()
Microsoft.AspNetCore.SpaServices.Extensions.Util.TaskTimeoutExtensions.WithTimeout(Task task, TimeSpan timeoutDelay, string message)
Microsoft.AspNetCore.SpaServices.Extensions.Proxy.SpaProxy.PerformProxyRequest(HttpContext context, HttpClient httpClient, Task baseUriTask, CancellationToken applicationStoppingToken, bool proxy404s)
Microsoft.AspNetCore.Builder.SpaProxyingExtensions+<>c__DisplayClass2_0+<b__0>d.MoveNext()
Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

Show raw exception details
InvalidOperationException: The npm script 'start' exited without indicating that the create-react-app server was listening for requests. The error output was: Error: EPERM: operation not permitted, mkdir 'C:\WINDOWS\system32\config\systemprofile\AppData\Roaming\npm' Error: EPERM: operation not permitted, mkdir 'C:\WINDOWS\system32\config\systemprofile\AppData\Roaming\npm'
Microsoft.AspNetCore.SpaServices.ReactDevelopmentServer.ReactDevelopmentServerMiddleware.StartCreateReactAppServerAsync(string sourcePath, string scriptName, string pkgManagerCommand, int portNumber, ILogger logger, DiagnosticSource diagnosticSource, CancellationToken applicationStoppingToken)`

I've verified this problem exists on two different computers. We see the same behaviour if you select "ASP.NET Core with React.js and Redux" in the final step of the project creation.

@pranavkm pranavkm added the area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates label Aug 18, 2021
@javiercn
Copy link
Member

@huwjeffries thanks for contacting us.

If you are targeting .NET Framework 4.8, can you confirm that you are trying to create an ASP.NET Core 2.1 app? No other ASP.NET Core version supports .NET Framework (classic).

I don't think this is an scenario we've covered in the past, so it is unlikely the templates work.

It'll be easier for you to switch to the current best practices approach recommended by SPA frameworks to integrate with different backends.

ASP.NET Core in 6.0 will be doing exactly that, so you can create a template for 6.0 and follow the same approach outlined there in your app.

@javiercn javiercn added the Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. label Aug 19, 2021
@huwjeffries
Copy link
Author

huwjeffries commented Aug 19, 2021

Hi there, thanks for your reply. Service Fabric 8 has full support for running .net 5. In fact it was the number 1 key feature of the release notes:

https://github.com/microsoft/service-fabric/blob/master/release_notes/Service_Fabric_ReleaseNotes_80.md#key-announcements

If you scroll down a little further to "Current Breaking Changes" you'll see that customers must target at least .net core 3.1 for the hosted service. Service fabric itself (the sfproj) must always run a full .net framework, but that does not limit the hosted service.

Please could you investigate further, as I think there is definitely an issue? Thanks.

@ghost ghost added Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. and removed Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. labels Aug 19, 2021
@davidfowl
Copy link
Member

@masnider can you help look at this?

@javiercn
Copy link
Member

@huwjeffries thanks for the additional details.

We didn't have the full picture, that's why we were asking for details. Seems like @davidfowl has already looped in the right folks.

@javiercn javiercn removed the Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. label Aug 19, 2021
@pranavkm pranavkm added this to the Discussions milestone Aug 24, 2021
@ghost
Copy link

ghost commented Nov 3, 2021

Thank you for contacting us. Due to a lack of activity on this discussion issue we're closing it in an effort to keep our backlog clean. If you believe there is a concern related to the ASP.NET Core framework, which hasn't been addressed yet, please file a new issue.

This issue will be locked after 30 more days of inactivity. If you still wish to discuss this subject after then, please create a new issue!

@ghost ghost closed this as completed Nov 3, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Dec 3, 2021
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates feature-spa
Projects
None yet
Development

No branches or pull requests

4 participants