Skip to content

Hot reload freezes if mistake in template file is corrected #26334

Closed

Description

@radekjakubowski

Which @angular/* package(s) are the source of the bug?

core

Is this a regression?

Yes

Description

While playing with Angular in dev mode I get stuck frequently at
image

Rerunning app with 'ng serve' resolves but it's annoying.

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

Application bundle generation complete. [0.074 seconds]
Reloading client(s)...

Please provide the environment you discovered this bug in (run ng version)

Angular CLI: 17.0.0
Node: v18.13.0

Anything else?

No response

Activity

  1. transferred this issue fromangular/angularon Nov 11, 2023
  2. JoostK commented on Nov 11, 2023

    @JoostK
    Member

    Could you provide some additional information about your setup:

    • What operating system is being used?
    • Which CLI builder is being used? @angular-devkit/build-angular:browser-esbuild or @angular-devkit/build-angular:application

    Some more general questions: how often does this occur? Could you identify which changes result in this behavior, or is it seemingly at random?

    Other than that, some things you could try:

    1. set the NG_BUILD_DEBUG_PERF=1 environment variable to log profiling data, which may reveal where things get stuck.
    2. set the NG_BUILD_PARALLEL_TS=0 environment variable to disable parallelization in certain areas.
  3. added
    needs: more info
    on Nov 11, 2023
  4. radekjakubowski commented on Nov 11, 2023

    @radekjakubowski
    Author

    I am using Windows 11 Home 22H2 and "builder": "@angular-devkit/build-angular:application".
    I'd say it's pretty frequent - once every 5-6 file saves and mainly I've been fiddling with html files.

    NG_BUILD_DEBUG_PERF=1 doesn't log as it gets stuck totally and only "Reloading client(s)" is there.
    Will try disabling parallelization later.

    Update:
    happens on both scenarios when there's some error and error html message is rendered, once making html template correct it loads up but hot reload stops working. Websocket connection is still in pending status while browsing network tab.

  5. kimanderssonm3cs commented on Nov 13, 2023

    @kimanderssonm3cs

    Hi! I can confirm the same behaviour when getting html error, then fixing it, then getting stuck in reloading.

  6. Alecto commented on Nov 13, 2023

    @Alecto

    The same for me

  7. scurk1415 commented on Nov 14, 2023

    @scurk1415

    I can also confirm that the same things happens with @angular-devkit/build-angular:browser-esbuild

  8. ChrisPienta1137 commented on Nov 15, 2023

    @ChrisPienta1137

    I also experienced this.
    Windows 11
    Angular CLI 17.0.0
    Node 20.9.0
    @angular-devkit/build-angular:application

  9. Ameerusa86 commented on Nov 16, 2023

    @Ameerusa86

    Same for me, I have to keep stopping and re run the projects, is there any fix, ty

  10. reduckted commented on Nov 16, 2023

    @reduckted

    This might be related to #26325 which has just been fixed and released (haven't tried it yet).

  11. radekjakubowski commented on Nov 16, 2023

    @radekjakubowski
    Author

    I tried it out for dependencies listed below:
    image

    And it doesn't work sadly... I'd bump my node to current version to see if it resolves issue (currently v18.13.0)

    After bumping up node to v20.9.0 issue still occurs.

  12. iqmeta commented on Nov 16, 2023

    @iqmeta

    Same here, happens random after 2 - 7 reloads:

    image

    "builder": "@angular-devkit/build-angular:application",

    Angular CLI: 17.0.0
    Node: 20.9.0
    Package Manager: npm 10.2.3
    OS: win32 x64 W11 22H2
    Chrome 119

    image

  13. 12 remaining items

  14. dgp1130 commented on Nov 20, 2023

    @dgp1130
    Collaborator

    17.0.2 should be out now with the fix. Please try it out and let us know if you're still seeing any challenges with the ng serve experience.

  15. radekjakubowski commented on Nov 21, 2023

    @radekjakubowski
    Author

    @dgp1130
    Hey Douglas, can confirm it's fixed :)

  16. ssougnez commented on Nov 21, 2023

    @ssougnez

    So far, so good for me as well/

  17. geosh2000 commented on Nov 23, 2023

    @geosh2000

    still happening:

    Captura de pantalla 2023-11-22 a la(s) 10 43 18 p m image

    package.json:

    {
    "name": "gg-erp17",
    "version": "0.0.0",
    "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "watch": "ng build --watch --configuration development",
    "test": "ng test"
    },
    "private": true,
    "dependencies": {
    "@angular/animations": "^17.0.4",
    "@angular/cdk": "^17.0.1",
    "@angular/common": "^17.0.4",
    "@angular/compiler": "^17.0.4",
    "@angular/core": "^17.0.4",
    "@angular/forms": "^17.0.4",
    "@angular/material": "^17.0.1",
    "@angular/platform-browser": "^17.0.4",
    "@angular/platform-browser-dynamic": "^17.0.4",
    "@angular/router": "^17.0.4",
    "rxjs": "~7.8.0",
    "tslib": "^2.6.2",
    "zone.js": "~0.14.2"
    },
    "devDependencies": {
    "@angular-devkit/build-angular": "^17.0.3",
    "@angular/cli": "^17.0.3",
    "@angular/compiler-cli": "^17.0.4",
    "@types/jasmine": "~5.1.0",
    "autoprefixer": "^10.4.16",
    "jasmine-core": "~5.1.0",
    "karma": "~6.4.0",
    "karma-chrome-launcher": "~3.2.0",
    "karma-coverage": "~2.2.0",
    "karma-jasmine": "~5.1.0",
    "karma-jasmine-html-reporter": "~2.1.0",
    "postcss": "^8.4.31",
    "tailwindcss": "^3.3.5",
    "typescript": "~5.2.2"
    }
    }

  18. ManciDRaffy commented on Nov 23, 2023

    @ManciDRaffy

    Same here, bug still occurs, but for me, it's every time I change something in HTML, so not only on fixing a bug

  19. alan-agius4 commented on Nov 23, 2023

    @alan-agius4
    Collaborator

    For those users who are still reporting file changes not triggering rebuilds, can you check if applying the changes in #26468 fixes the issue?

    This can be done by installing the snapshot builds which is currently not on NPM

    npm i https://github.com/angular/angular-devkit-build-angular-builds#cf42e6ade83e480cd29b8eba43f8daaf76367b4c --save-dev --force
    
  20. HCenggel commented on Nov 24, 2023

    @HCenggel

    I have the default configuration. After using ng serve to start the project, this problem will also occur.

  21. muhamedkarajic commented on Nov 25, 2023

    @muhamedkarajic

    To me it seems like its cause I was using something instead of app-root. Another thing which I had quit a few issues was that I was using direct import ... from 'src/app/...' which seems now not anymore to work, so you have to use '../../..' etc.

  22. nejat-njonjo commented on Nov 26, 2023

    @nejat-njonjo

    What I have figured is that, if one of your files has issues, Angular doesn't throw an error, which leads to the Browser just keeping on loading. I hope this gets fixed soon.

    E.g You are current_file < import_in_2 < import_in_3

    So if the import_in_3 file has errors, can lead to such behaviours.
    If you are using SSR, make sure you specify the platform using PlatformId

  23. tarzasai commented on Nov 30, 2023

    @tarzasai

    Same here, bug still occurs, but for me, it's every time I change something in HTML, so not only on fixing a bug

    Me too and while it was happening only on html errors in 17.0.0, with 17.0.2 I have to re-serve after every change, even if the html is correct.

  24. devmadou commented on Nov 30, 2023

    @devmadou

    Hi, guys.
    First, thanks for the great work on v17.

    I am experiencing the same issue even on 17.0.5.
    I noticed the error occurred on a custom scss file I created where I am defining a custom theme:

      $custom-light-theme: mat.define-light-theme((
          color: (
              primary: $web-ng-primary,
              accent: $web-ng-accent,  // Omit the accent color and the same freezing behavior will happen
          ),
      ));

    I am able to reproduce the issue when purposely introducing an error when calling the built-in mat.define-light-theme function without the accent palette.
    When I correct the error, the file change seems detected but no build is triggered and the page remains stuck in that error state.

  25. angular-automatic-lock-bot commented on Jan 18, 2024

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  26. locked and limited conversation to collaborators on Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions