Improve the Stack Trace when an HTML Parsing Error is Encountered

This issue has been tracked since 2022-09-20.

Which @angular/* package(s) are relevant/related to the feature request?

No response


I have noticed that when I make a syntax mistake in the HTML of a component the Angular Compiler throws a vast amount of errors, so much so that the original offending error is buried in a huge stack trace that is cut off in the terminal window of VS Code, my preferred Code Editor for Angular. This can be worked around by exporting the stack trace to common error in the form a text file, however it would be very convenient if I could avoid these extra steps to identify the location of bad HTML.

Ideally, when there is a syntax error in the HTML, I would like an option to be able to have the compiler simply identify the line where the HTML syntax is malformed and skip errors resulting from the malformed HTML syntax which would make the Stack Trace much more useful without needing to resort to workarounds for the issue.

Proposed solution

Introduce an option that suppresses all errors in a stack trace except for the first one when the error is caused by a malformed HTML element (syntax error).

Alternatives considered

A workaround is to export the output to a txt file and read the text file, but this can become cumbersome and adds friction to the normal workflow of a project. Being able to simply and easily see where an HTML syntax error is located in the console without having to resort to the above workaround would be ideal.

Below is an example of the top of the stack trace in VS Code and the syntax error that generated it. Simply identifying the line with the error without showing all the additional errors would make the error output much more readable and useful

Top of HTML syntax stack trace
Example Syntax Error

More Details About Repo
Owner Name angular
Repo Name angular
Full Name angular/angular
Language TypeScript
Created Date 2014-09-18
Updated Date 2022-09-30
Star Count 84091
Watcher Count 3064
Fork Count 22233
Issue Count 1203


Issue Title Created Date Updated Date