-
Notifications
You must be signed in to change notification settings - Fork 24.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AoT Compilation not detecting template error #20287
Comments
Actually I am seeing this on 4.4.4 as well. Maybe it's related to a TypeScript version? We are using TS 2.4.2 |
Tried TS 2.5.3 and TS 2.6.1, so unlikely it's a TS issue. Maybe I am not configuring a setting correctly or something.. |
Can be reproduced in edit.ng directly. |
I'm seeing this issue for *ngFor as well. I tested it with the following: In app.component.ts:
In app.component.ng.html:
If I change I also tried compiling with
As you can see, when accessing Edit: This angular/angular-cli#5764 might also be related? |
@trotyl the provided link doesn't work anymore 😉 |
@BorntraegerMarc fixed, just mean it literally. |
Same issue here when using *ngIf. |
This is a know bug which we are working on fixing right now. Duplicate of #19792 |
any update on this one? we're still facing this issue, thanks |
@lichunr For some additional template type checking you should set Template type checking is still poor, but is improved with Renderer 3 (Ivy). Even with Angular 8 with Renderer 3 you still need to set |
@vanslly Thx for the solution! |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
I'm submitting a...
Current behavior
A component has public properties,
heroTitle: string
,v2Layout: boolean
.In template:
This works, as expected, no error reported.
I will modify template like so:
Now, there is no error reported in the AoT compiler, even if I kill the watcher and do a full rebuild.
Furthermore, if one does this:
We get a compilation error in AoT, both in Full Rebuild and Watcher
I am pretty sure this if happening because of
*ngIf
but no way to be sure. I have seen this in other parts of our application too. On things like[class.foo]="something"
if an*ngIf
is above it, the compiler won't catch typos, etc.Expected behavior
I would expect in each case where I am using
{{ heroTitleeeeee }}
the AoT compiler fails the build.Minimal reproduction of the problem with instructions
Above
What is the motivation / use case for changing the behavior?
We'd like our AoT builds to be able to detect these errors so that we don't have typos and other issues on our templates before checking in / testing.
Environment
Windows 10
The text was updated successfully, but these errors were encountered: