Skip to content

⚠️ Local development bugs with HMR #59602

@dgp1130

Description

@dgp1130

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

compiler-cli

Is this a regression?

Yes

Description

We're aware of reports of local development bugs arising from Angular template HMR in 19.1.x, which has been enabled by default.

List of known issues:

We're actively investigating and fixing these issues to create a smooth HMR experience out of the box. Production builds and releases are not affected. If you discover any additional HMR challenges which don't appear to be related to the linked issues above, verify that you are on a recent version (19.1.3+), and please file a new issue and link it here so we can triage and investigate.

Workarounds

In the meantime, if you encounter any problems relating to HMR, you can work around them in three ways:

  1. Refresh the page - This loads a fresh copy of your application with up to date code.
  2. ng serve --no-hmr - This disables HMR for your local devserver and automatically refreshes the page on any code changes.
  3. Disable HMR for your project - Configuring angular.json will disable HMR for all ng serve invocations by default.
    • This is useful for a project with a large number of developers without needing to communicate these workarounds to all contributors.
    • Remember to re-enable once the relevant issues are fixed!
{
  "projects": {
    "my-project": {
      "architect": {
        "serve": {
          "options": {
            "hmr": false
          }
        }
      }
    }
  }
}

Thank you for sharing any HMR issues and helping improve Angular one bugfix at a time. We're committed to fully stabilizing this feature and excited to bring improved build performance to everyone.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions