Skip to content

ViewContainerRef breaks HMR #59592

Closed
Closed

Description

@serfreeman1337

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

Don't known / other

Is this a regression?

Yes

Description

If a component has ViewContainerRef injected changing its template does not trigger live reload.

import { Component, inject, ViewContainerRef } from '@angular/core';
import { RouterOutlet } from '@angular/router';

@Component({
  selector: 'app-root',
  imports: [RouterOutlet],
  templateUrl: './app.component.html',
  styleUrl: './app.component.css'
})
export class AppComponent {
  title = 'test-app';

  private viewContainerRef = inject(ViewContainerRef); 
}

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

Angular CLI: 19.1.1
Node: 22.13.0
Package Manager: npm 11.0.0
OS: linux x64

Angular: 19.1.1
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1901.1
@angular-devkit/build-angular   19.1.1
@angular-devkit/core            19.1.1
@angular-devkit/schematics      19.1.1
@schematics/angular             19.1.1
rxjs                            7.8.1
typescript                      5.7.3
zone.js                         0.15.0

Anything else?

No response

Activity

  1. added
    area: core
    on Jan 17, 2025
  2. modified the milestone: needsTriage on Jan 17, 2025
  3. self-assigned this
    on Jan 17, 2025
  4. added a commit that references this issue on Jan 17, 2025
    6d4e9f5
  5. added a commit that references this issue on Jan 20, 2025
    6f77162
  6. added a commit that references this issue on Jan 20, 2025
    2caa45a
  7. added a commit that references this issue on Feb 7, 2025
    9b913f8
  8. angular-automatic-lock-bot commented on Feb 20, 2025

    @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.

  9. locked and limited conversation to collaborators on Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area: corecore: hot module replacement (HMR)state: has PR

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions