3

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?

2
  • make sure you did npm install before doing this and manually check running ng serve in target folder and make sure it serving within the specified time Commented Jun 14, 2019 at 5:56
  • any update on this issue? Commented Aug 12, 2019 at 9:37

3 Answers 3

3

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

Sign up to request clarification or add additional context in comments.

4 Comments

I have given the TimeSpan to 5 mins but still getting the same error. Any suggestion?
@JagzW just update my answer. The dotnet run solve the problem for me
I run the command in command window but getting error saying "Command "dotnet" is not valid."
You need to install dotnet core sdk
1

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/

Comments

0

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 :

  1. In command prompt, Run the 'ng serve' command to run the angular solution.
  2. In startup.cs file, change the start up timeout to minutes. even it will not take that much of time as angular solution is already running.

-> spa.Options.StartupTimeout = new TimeSpan(0, 5, 0);

Please mark the answer if it helps you !!

Thanks.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.