Angular application stuck in endless compile loop

Himanshu Chaudhary 0 Reputation points
2023-03-21T12:10:41.9566667+00:00

My angular application keeps on compiling when i run 'ng serve' command.

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,055 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Dou Xu-MSFT 170 Reputation points Microsoft Vendor
    2023-03-22T08:04:59.2633333+00:00

    Hello@Himanshu Chaudhary,

    Thanks for taking time to post this issue in Microsoft Q&A forum.

    The below document says ng serve: Builds and serves your application, rebuilding on file changes. if there is any single file change and it will goes into loop compilation. I use ng serve to compile angular application and modify some files during compilation ,then i find it keeps on compiling.

    https://angular.io/cli/serve

    Test environment:

    Angular CLI: 15.2.4

    Node: 18.13.0

    Package Manager: npm 8.19.3

    Test result:

    Picture1

    Here’re suggestions you can check:

    1 Save all your files in your angular project and use ng serve to build again and Ensure that no file changes are made during compilation.

    2 add -- watch and set it to false(it’s default value is true).After setting -- watch to false, it will not rebuild on change.

    ng serve --watch false
    

    BTW  I'm not sure if that will fully address your problem .Could you provide your simple reproduce code and compiling output screenshot for us  to investigate further and provide effective solutions?

    Feel free to contact us.

    Sincerely,

    Douxu

    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.