Skip to content

Template HMR fails with two way binding (RForms, TForms) #58915

@jmerro-c3d

Description

@jmerro-c3d

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

compiler, core, Don't known / other

Is this a regression?

No

Description

import { Component } from '@angular/core';
import { FormsModule } from '@angular/forms';

@Component({
  selector: 'app-root',
  imports: [FormsModule],
  templateUrl: './app.component.html',
})
export class AppComponent {
  msgBox = ""
}
<main class="main">
      <div>
        Input Value:
        {{ msgBox }}
      </div>
      <input [(ngModel)]="msgBox" />
</main>

No error message on first load, after making changes to template fails with error.

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

app.component.ts:13 Uncaught (in promise) ReferenceError: i1 is not defined
    at AppComponent_UpdateMetadata (app.component.ts:13:38)
    at Module.ɵɵreplaceMetadata (core.mjs:32134:17)
    at app.component.ts:12:26

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

Angular CLI: 19.0.2
Node: 20.17.0
Package Manager: npm 10.8.2
OS: linux x64

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

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1900.2
@angular-devkit/build-angular   19.0.2
@angular-devkit/core            19.0.2
@angular-devkit/schematics      19.0.2
@angular/cli                    19.0.2
@schematics/angular             19.0.2
rxjs                            7.8.1
typescript                      5.6.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