Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

No error showing in HTML for invalid Angular IF statement #55812

Open
1 of 2 tasks
ryan-nis opened this issue May 15, 2024 · 3 comments
Open
1 of 2 tasks

No error showing in HTML for invalid Angular IF statement #55812

ryan-nis opened this issue May 15, 2024 · 3 comments
Labels
area: compiler Issues related to `ngc`, Angular's template compiler compiler: extended diagnostics compiler: template type-checking feature Issue that requests a new feature
Milestone

Comments

@ryan-nis
Copy link

馃悶 bug report

Is this a regression?

Unsure, only just noticed this being an issue whilst working through someone elses code.

Description

The bug seems to be not highlighting an Angular if statement as an error when it contains an else reference but no else property.

Bug Type

What does this bug affect

  • Angular Language Service VSCode extension
  • Angular Language Service server

Reproduction

Steps to reproduce the behavior:

  1. Write an if statement in Angular HTML file and do not include the else property when including an else reference. E.g. <ng-container *ngIf="data; newData"></ng-container>.
  2. This snippet will not show any errors in the server or logs or within the Editor IDE, but will not render the else condition on the Front-End. Again no errors showing that this is a problem.

Expected behavior

Should be highlighted as a syntax error in VSCode.

Logs

Log file gives us deep insight into the behavior and performance of the extension. If the issue is a performance
problem or an error occured, please provide the output of the log file below.

Set Angular Log level to verbose.


No log file required as no erros are being thrown

Screenshots

If applicable, add screenshots to help explain your problem.

image

馃實 Your Environment

Angular Version:


15.2.10

Extension Version:


v17.3.2

VSCode Version:


Version: 1.89.0 (system setup)
Commit: b58957e67ee1e712cebf466b995adf4c5307b2bd
Date: 2024-05-01T02:09:22.859Z
Electron: 28.2.8
ElectronBuildId: 27744544
Chromium: 120.0.6099.291
Node.js: 18.18.2
V8: 12.0.267.19-electron.0
OS: Windows_NT x64 10.0.14393

Operating System:


Windows Server 2016 Version 10.0.14393 Build 14393

Extension options:


N/A

Anything else relevant?

@ryan-nis ryan-nis added the bug label May 15, 2024
@atscott atscott transferred this issue from angular/vscode-ng-language-service May 15, 2024
@atscott
Copy link
Contributor

atscott commented May 15, 2024

This is not a compilation error so there will not be an error displayed in the language service. Moving to the main angular/angular repo, as this could be addressed by either a template diagnostic or potentially additional compiler checks on the star syntax

@atscott atscott added feature Issue that requests a new feature area: compiler Issues related to `ngc`, Angular's template compiler compiler: template type-checking compiler: extended diagnostics and removed bug labels May 15, 2024
@ngbot ngbot bot modified the milestone: Backlog May 15, 2024
@Tweniee
Copy link
Contributor

Tweniee commented May 16, 2024

True it seems like a compilation error

@JeanMeche
Copy link
Member

Fwiw, the @if block doesn't suffer from the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: compiler Issues related to `ngc`, Angular's template compiler compiler: extended diagnostics compiler: template type-checking feature Issue that requests a new feature
Projects
None yet
Development

No branches or pull requests

4 participants