Skip to content

ViewContainerRef breaks HMR #59592

@serfreeman1337

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions