Reputation: 2838
When staring debug after 60 sec waiting this shows in the browser. Refreshing the browser window and 15 sec later everything works ok
An unhandled exception occurred while processing the request. TimeoutException: The Angular CLI process did not start listening for requests within the timeout period of 50 seconds. Check the log output for error information.
Any idea?
Upvotes: 3
Views: 3226
Reputation: 109
For development purpose if you are getting the error as 'TimeoutException: The Angular CLI process did not start listening for requests within the timeout period of 0 seconds.' .
Please follow these 2 steps which work for me as well :
-> spa.Options.StartupTimeout = new TimeSpan(0, 5, 0);
Please mark the answer if it helps you !!
Thanks.
Upvotes: 0
Reputation: 449
I was able to fix this issue by modifying package.json file. It was needed to slightly change "start" script ("start": "echo Starting... && ng serve"). Additional info here: https://jasontaylor.dev/asp-net-core-angular-9-upgrade/
Upvotes: 1
Reputation: 20092
That is because the angular CLI is not bootstrap fast enough so to fix it you have 2 options
Increase a time out in Startup.cs
app.UseSpa(spa =>
{
spa.Options.SourcePath = "ClientApp";
if (env.IsDevelopment())
{
spa.Options.StartupTimeout = new TimeSpan(0, 0, 80); // 80 seconds
spa.UseAngularCliServer(npmScript: "start");
}
});
or navigate to ClientApp folder run ng serve
and wait for compilation process is done so you can run your project again
Update: I find the way to resolve this error is running dotnet run
in the cmd
Upvotes: 3