Repository navigation
Closed
Labels
area: language-serviceIssues related to Angular's VS Code language service
Milestone
Description
Is this a bug report or a feature request?
- Bug Report
- Feature Request
Please provide the steps to reproduce the issue [Bug Report only]
When use template literal in component template binding, it start crash.
For example, if we have following template.
<div>{{ obj.name() }}</div>Now we want to add an ID to the div.
Let's type bracket id first.
<div [id]="">{{ obj.name() }}</div>At this stage, everything is fine.
<div [id]="`object_${}`">{{ obj.name() }}</div>Once typed in ${} the language service crashed.
Please provide the expected behavior vs the actual behavior you encountered [Bug Report only]
It should not crash.
Please provide a screenshot if possible [Bug Report only]
Crash error below.
Please provide the exception or error you saw [Bug Report only]
c:\Users\{userId}\.vscode\extensions\angular.ng-template-22.0.1\node_modules\@angular\language-service\bundles\language-service.js:38483
return ast.visit(this);
^
TypeError: Cannot read properties of undefined (reading 'visit')
at TcbExprTranslator.translate (c:\Users\{userId}\.vscode\extensions\angular.ng-template-22.0.1\node_modules\@angular\language-service\bundles\language-service.js:38483:24)
at TcbExprTranslator.visitTemplateLiteral (c:\Users\{userId}\.vscode\extensions\angular.ng-template-22.0.1\node_modules\@angular\language-service\bundles\language-service.js:38706:49)
at TemplateLiteral.visit (c:\Users\{userId}\.vscode\extensions\angular.ng-template-22.0.1\node_modules\@angular\language-service\bundles\language-service.js:5283:28)
at TcbExprTranslator.translate (c:\Users\{userId}\.vscode\extensions\angular.ng-template-22.0.1\node_modules\@angular\language-service\bundles\language-service.js:38483:24)
at astToTcbExpr (c:\Users\{userId}\.vscode\extensions\angular.ng-template-22.0.1\node_modules\@angular\language-service\bundles\language-service.js:38465:27)
at TcbExpressionTranslator.translate (c:\Users\{userId}\.vscode\extensions\angular.ng-template-22.0.1\node_modules\@angular\language-service\bundles\language-service.js:38947:20)
at tcbExpression (c:\Users\{userId}\.vscode\extensions\angular.ng-template-22.0.1\node_modules\@angular\language-service\bundles\language-service.js:38876:27)
at translateInput (c:\Users\{userId}\.vscode\extensions\angular.ng-template-22.0.1\node_modules\@angular\language-service\bundles\language-service.js:40322:20)
at TcbDirectiveCtorOp.execute (c:\Users\{userId}\.vscode\extensions\angular.ng-template-22.0.1\node_modules\@angular\language-service\bundles\language-service.js:41074:40)
at Scope.executeOp (c:\Users\{userId}\.vscode\extensions\angular.ng-template-22.0.1\node_modules\@angular\language-service\bundles\language-service.js:41711:26)
Description [Feature Request only]
No response
Proposed solution [Feature Request only]
No response
Alternatives considered [Feature Request only]
No response
Metadata
Metadata
Assignees
Labels
area: language-serviceIssues related to Angular's VS Code language service
Activity
hawkgs commentedon Jul 9, 2026
I don't think I am able to reproduce the error that you've described. The app breaks, which is expected given there isn't an interpolated value, but I wasn't able to break the language service.
I see that you are using the latest version (22.0.1). What's your Angular app version?
Nness commentedon Jul 9, 2026
"@angular/core": "^22.0.4",type order:
Nness commentedon Jul 9, 2026
It might due to angular language service try to get suggestion of variables, since it is in an
[]blockNness commentedon Jul 9, 2026
Similar to the other language service crash I have reported last time. #69106
Nness commentedon Jul 9, 2026
I'm in a large project, so when language service crash, I can easily notice it, since it take ages to boot back.
hawkgs commentedon Jul 9, 2026
I see that you are encountering the error in an app of some sort. Can you please verify that you can reproduce the issue with the minimal reproducible demo that you shared in the description of the issue, i.e.
<div [id]="object_${}">{{ obj.name() }}</div>?Feels like there is something else that affects the language service that is probably missing in that example.
Nness commentedon Jul 9, 2026
I have tried on another small project. language server crash again, even though it load back directly. How do you test? The language service has debounce time, so after you type
[id]="test_${}", you have to wait 1~2 seconds, then language service pick it up and try to provide option, and it crash.Nness commentedon Jul 9, 2026
when cursor inside here. it crashed, here is test project I created last time. Exactly same behaviour.
config-test.zip
hawkgs commentedon Jul 9, 2026
Managed to reproduce it in on of my apps. 👍
[-]Angular Language Service crashes with "Cannot read properties of undefined (reading 'visit')" when template literal is used in component template binding[/-][+]Angular Language Service crashes when there is an empty template literal interpolation[/+]hawkgs commentedon Jul 9, 2026
Updated the title to better reflect the issue. It's reproducible for all empty literal interpolations
${}in the templatefix(compiler): parsing of an empty template literal interpolation
fix(compiler): parsing of an empty template literal interpolation
angular-automatic-lock-bot commentedon Aug 9, 2026
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.