Template type checking re-builds do not run correctly when referencing a re-exported type
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 35/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- angular, typescript
- Bereich
- build-system
Rechercherichtung
Beginnen Sie mit der verknüpften Minimalreproduktion und führen Sie ng serve mit aktivierter Template-Typprüfung unter den angegebenen Angular- und Node-Versionen aus. Ändern Sie MyType zwischen den Definitionen abc und abcd und untersuchen Sie anschließend die Pfade für den Angular CLI-Neuaufbau und die Template-Typprüfung. Als abgeschlossen gilt es, wenn das Zurücksetzen der Typdefinition den Template-Fehler beim Neuaufbau entfernt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Which @angular/* package(s) are the source of the bug?
Don't known / other
Is this a regression?
Yes
Description
Consider the following example, running ng serve with template type checking turned on:
- An Angular template references a property on the component class in an expression.
- This component class properties type definition comes from a file which re-exports the type definition from another file.
- Re-builds do not always re-compile the template expression when they should.
More specifically, in the reproduction repo this looks as follows:
- The app component template includes an expression:
{{ myType?.abc }}. - The app component class defines the myType property:
myType?: MyTypeReExported. - The type of the myType property comes from a file which re-exports another type.
export type MyTypeRexported = MyType. - The type MyType comes from a file which defines the definition as:
export interface MyType { abc: 123; }. - The initial ng serve will run without errors.
- Changing the type definition of MyType to be
export interface MyType { abcd: 123; }causes an error in the app component's template. This is seen in the re-build console output. This is the correct behaviour. - Changing the type definition back to what it was originally should remove the error. However, it does not. That is the bug.
Please provide a link to a minimal reproduction of the bug
https://github.com/HazzMan2409/angular-template-rebuild-bug
Please provide the environment you discovered this bug in
Angular 12.2.5.
Node 14.17.6
See the package.json on the repo for more details. At the time 12.2.5 was the latest version.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 27k
- Forks
- 11.8k
- Ø Merge
- 17 Std. 25 Min.
- Gemergte PRs (30 T.)
- 183
Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus angular/angular-cli
-
area: @angular/build gemini-triaged
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
angular/angular-cli#33955 ·
-
area: @angular/cli gemini-triaged
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
angular/angular-cli#33055 · 1 Kommentar · 3 Reaktionen ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34131 · 1 zugewiesene Person ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34130 · 1 zugewiesene Person ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34128 · 1 zugewiesene Person ·
Alle Issues in angular/angular-cli
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
-
bug v2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
modelcontextprotocol/inspector#2458 · 1 Kommentar ·
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 75/100
railmapgen/rmp-gallery#4068 ·
-
Mend: dependency security vulnerability status: needs triage 🕵️♀️
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
carbon-design-system/ibm-products#9907 ·