dotnet / AspNetCore.Docs

Documentation for ASP.NET Core
https://docs.microsoft.com/aspnet/core
Creative Commons Attribution 4.0 International
12.57k stars 25.3k forks source link

spa.UseAngularCliServer(npmScript: "start"); still doesnt work for me 3rd Jan 2021 #21102

Closed donkeybrains closed 3 years ago

donkeybrains commented 3 years ago

[Enter feedback here] Hi Guys

This started when I was tasked with working on an Anuglar/dotnet core 3.1 application. Out of the repo it didnt work for me yet did for others. Im working on a VPN and behind a corporate proxy.

So back to basics check the environment with a basic Angular/Dotnet core app from the weather template. If I get this to work then the rest will fall into place.

I create the basic Anugular app on the work PC over the VPN and run it the CLI timesout, no matter how long I give it.

Damned if I can see what the issue is.

Before I do one of them numb from the neck up lists, Ill do a quick list for you. If you need more let me know.

VS 2019 update 16.8.3 //=================== PS C:\WINDOWS\system32> dotnet --info .NET SDK (reflecting any global.json): Version: 5.0.101 Commit: d05174dc5a

Runtime Environment: OS Name: Windows OS Version: 10.0.17763 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\5.0.101\

Host (useful for support): Version: 5.0.1 Commit: b02e13abab

.NET SDKs installed: 3.1.100 [C:\Program Files\dotnet\sdk] 5.0.101 [C:\Program Files\dotnet\sdk]

.NET runtimes installed: Microsoft.AspNetCore.All 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.2.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.2.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.1.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 3.1.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 5.0.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

To install additional .NET runtimes or SDKs: https://aka.ms/dotnet-download PS C:\WINDOWS\system32> //===========================


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Rick-Anderson commented 3 years ago

Moved to Master issue: Use the Angular project template with ASP.NET Core #18074

MackinnonBuck commented 1 year ago

The SPA proxy startup can timeout on slower machines, and increasing the timeout usually fixes the issue. I see that the timeout is being set to 80 seconds - I've seen it take longer than that (2+ minutes) on very slow machines. I wonder if setting the timeout to something absurd (e.g. an hour) would work?

If there is a docs fix for this, it's probably not Angular-specific. It would probably be covered in #18405.

jpeckham commented 5 months ago

The SPA proxy startup can timeout on slower machines, and increasing the timeout usually fixes the issue. I see that the timeout is being set to 80 seconds - I've seen it take longer than that (2+ minutes) on very slow machines. I wonder if setting the timeout to something absurd (e.g. an hour) would work?

If there is a docs fix for this, it's probably not Angular-specific. It would probably be covered in #18405.

it worked for me with angular 12. i deleted the clientapp and did a new app with ng 17 now it times out even with a 5 minute timeout. app.UseSpa(spa => { // To learn more about options for serving an Angular SPA from ASP.NET Core, // https://learn.microsoft.com/en-us/aspnet/core/client-side/spa-services?view=aspnetcore-3.0&viewFallbackFrom=aspnetcore-6.0

spa.Options.SourcePath = "ClientApp";

if (env.IsDevelopment())
{
    spa.Options.StartupTimeout = TimeSpan.FromMinutes(5);
    spa.UseAngularCliServer(npmScript: "start");
    //spa.UseProxyToSpaDevelopmentServer("http://localhost:4200");
}

});