JavaScriptServices icon indicating copy to clipboard operation
JavaScriptServices copied to clipboard

ASP.NET Core 2.1 Preview 2 Angular CLI App is not starting on debug mode

Open tanvirarjel opened this issue 8 years ago • 9 comments

I have created an app selecting template angular with asp.net core 2.1 preview2-final on visual studio 2017 Version 15.6.6 . It runs gracefully without debug mode but does not run anyway on debug mode..It continuously showing the following exception :

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.
Microsoft.AspNetCore.SpaServices.Extensions.Util.TaskTimeoutExtensions.WithTimeout<T>(Task<T> task, TimeSpan timeoutDelay, string message)
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.
Microsoft.AspNetCore.SpaServices.Extensions.Util.TaskTimeoutExtensions.WithTimeout<T>(Task<T> task, TimeSpan timeoutDelay, string message)
Microsoft.AspNetCore.SpaServices.Extensions.Proxy.SpaProxy.PerformProxyRequest(HttpContext context, HttpClient httpClient, Task<Uri> baseUriTask, CancellationToken applicationStoppingToken, bool proxy404s)
Microsoft.AspNetCore.Builder.SpaProxyingExtensions+<>c__DisplayClass2_0+<<UseProxyToSpaDevelopmentServer>b__0>d.MoveNext()
Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext)
Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

I have tried with changing the startup timeout value as follows but no luck:

app.UseSpa(spa =>
            {
                spa.Options.SourcePath = "ClientApp";

                if (env.IsDevelopment())
                {
                    spa.Options.StartupTimeout = new TimeSpan.FromSeconds(120);
                    spa.UseAngularCliServer(npmScript: "start");
                }
            });

tanvirarjel avatar Apr 23 '18 12:04 tanvirarjel

I have the same issue using 15.7 Preview 4. If I run my project from the command line, using dotnet run, the website loads up but the "Fetch data" page is broken (always "Loading...").

a688 avatar Apr 24 '18 20:04 a688

+1 Just setup a new Angular dotnet core 2.1 app running 'dotnet run' from cmd works fine! But F5 in Visual Studio 2017 (and VS 2017 Preview) doesn't work and always results in the error above. The console however shows that the 'ng serve' command runs successfully

Khaos66 avatar May 19 '18 21:05 Khaos66

Problem is fixed in ASP.NET Core 2.1 RC..Now everything is okay and working as expected.

tanvirarjel avatar May 19 '18 21:05 tanvirarjel

You are right switching from '2.1.0-preview2-final' to '2.1.0-rc1-final' fixed the problem

Khaos66 avatar May 21 '18 11:05 Khaos66

Yes, it was fixed in the RC release.

SteveSandersonMS avatar May 29 '18 10:05 SteveSandersonMS

Using ASP.NET Core 2.1, issue still exists

hellovsvijay avatar Sep 21 '18 19:09 hellovsvijay

Using ASP.NET Core 2.1 issue still exists

1YasirAli avatar Oct 09 '18 08:10 1YasirAli

Refreshing (F5) the page solved the problem and it works fine.

manishmawat avatar Oct 12 '18 02:10 manishmawat

Issues still exists, however just waiting it out and the angular builds, from my end the issue seems to be caused by the build order. What I mean is that the Server side code builds faster than the angular code, hence after waiting a second or two the error disappears

Flipponachi avatar Oct 18 '18 04:10 Flipponachi