TimeoutException: The Angular CLI process did not start listening for requests within the timeout period TimeoutException: The Angular CLI process did not start listening for requests within the timeout period angular angular

TimeoutException: The Angular CLI process did not start listening for requests within the timeout period


Taken from here and here, it appears to work well in .NET Core 3 and Angular 9. Modify the way the Angular server is started in package.json to add a dummy echo:

"start": "ng serve"

becomes

"start": "echo Starting && ng serve"


ASP.NET Core >= 3.0

If you are using asp.net core 3.0 then you should not use UseAngularCliServer instead. You should use asp.net as a proxy for development. more detail is here

app.UseSpa(spa =>            {                spa.Options.SourcePath = "ClientApp";                if (env.IsDevelopment())                {                    spa.UseProxyToSpaDevelopmentServer("http://localhost:4200");                }            });

open command widnow, go to ClientApp and start npm server.

c:\your\project\directory\> cd ClientAppc:\your\project\directory\> npm start

ASP.NET Core 2.0

refresh(F5) your browser or increase timeout for SPA configuration

app.UseSpa(spa =>            {                spa.Options.SourcePath = "ClientApp";                if (env.IsDevelopment())                {                    spa.UseAngularCliServer(npmScript: "start");                    spa.Options.StartupTimeout = TimeSpan.FromSeconds(200); // <-- add this line                }            });

In the development environment, npm builds an angular app before serving. some times build takes longer than 120 seconds.


Refreshing (F5) the page solved the problem for me.