Angular-CLI call is starting browser too soon and causing timeout #257

Closed
opened 2025-08-09 17:15:36 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @SpeedHighway on 12/18/2017

I noticed that this appears to have been added in PR https://github.com/aspnet/JavaScriptServices/pull/1367

This line:

openBrowserLine = await npmScriptRunner.StdOut.WaitForMatch(
  new Regex("open your browser on (http\\S+)", RegexOptions.None, RegexMatchTimeout),
 StartupTimeout);

Is causing my site to fail every time, unless I manually stop the browser quickly, after pressing F5 (or Ctrl F5) in Visual Studio

Because of the fact that the console window appears and states:

** NG Live Development Server is listening on localhost:5155, open your browser on http://localhost:5155/ **

The browser opens immediately, as it starts to do the build. However, the build definitely does not finish in 50 seconds, so then it times out (displaying an error while building) and gets stuck unusable due to hitting the exception for the timeout. Unfortunately the machine I'm on is not terribly fast so it occurs every time. (And worse if I have Chrome open to the site, because then I can't get it to not timeout, ever.)

The browser should not be opening up until the webpack: Compiled successfully. appears, unless I'm mistaken.

Thanks

*Originally created by @SpeedHighway on 12/18/2017* I noticed that this appears to have been added in PR https://github.com/aspnet/JavaScriptServices/pull/1367 This line: ``` openBrowserLine = await npmScriptRunner.StdOut.WaitForMatch( new Regex("open your browser on (http\\S+)", RegexOptions.None, RegexMatchTimeout), StartupTimeout); ``` Is causing my site to fail every time, unless I manually stop the browser quickly, after pressing F5 (or Ctrl F5) in Visual Studio Because of the fact that the console window appears and states: > ** NG Live Development Server is listening on localhost:5155, open your browser on http://localhost:5155/ ** The browser opens immediately, as it starts to do the build. However, the build definitely does not finish in 50 seconds, so then it times out (displaying an error while building) and gets stuck unusable due to hitting the exception for the timeout. Unfortunately the machine I'm on is not terribly fast so it occurs every time. (And worse if I have Chrome open to the site, because then I can't get it to not timeout, ever.) The browser should not be opening up until the `webpack: Compiled successfully.` appears, unless I'm mistaken. Thanks
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#257
No description provided.