Skip to content

Build error when using template literal with @let or track #60528

Closed

Description

@g-drouard

Which @angular/* package(s) are the source of the bug?

compiler

Is this a regression?

No

Description

In Angular 19.2 template literals are allowed in template files but when using with @let or track this causes a build error.

There are surely other cases that I have not noticed.

Please provide a link to a minimal reproduction of the bug

https://stackblitz.com/edit/sb1-uvh8sdq9?file=src%2Fmain.ts,src%2Ftemplate.html

Please provide the exception or error you saw

✘ [ERROR] Angular compilation emit failed. [plugin angular-compiler]

  Error: Debug Failure. Invalid raw text
      at checkTemplateLiteralLikeNode (/home/projects/sb1-uvh8sdq9/node_modules/typescript/lib/typescript.js:26263:22)
      at Object.createNoSubstitutionTemplateLiteral (/home/projects/sb1-uvh8sdq9/node_modules/typescript/lib/typescript.js:26318:12)
      at TypeScriptAstFactory.createTemplateLiteral (file:///home/projects/sb1-uvh8sdq9/node_modules/@angular/compiler-cli/bundles/chunk-KOIBHR3X.js:3129:53)
      at ExpressionTranslatorVisitor.visitTemplateLiteralExpr (file:///home/projects/sb1-uvh8sdq9/node_modules/@angular/compiler-cli/bundles/chunk-KOIBHR3X.js:2500:48)
      at TemplateLiteralExpr.visitExpression (file:///home/projects/sb1-uvh8sdq9/node_modules/@angular/compiler/fesm2022/compiler.mjs:1545:24)
      at ExpressionTranslatorVisitor.visitExpressionStmt (file:///home/projects/sb1-uvh8sdq9/node_modules/@angular/compiler-cli/bundles/chunk-KOIBHR3X.js:2466:81)
      at ExpressionStatement.visitStatement (file:///home/projects/sb1-uvh8sdq9/node_modules/@angular/compiler/fesm2022/compiler.mjs:2180:24)
      at eval (file:///home/projects/sb1-uvh8sdq9/node_modules/@angular/compiler-cli/bundles/chunk-KOIBHR3X.js:2635:42)
      at ExpressionTranslatorVisitor.visitStatements (file:///home/projects/sb1-uvh8sdq9/node_modules/@angular/compiler-cli/bundles/chunk-KOIBHR3X.js:2635:23)

Please provide the environment you discovered this bug in (run ng version)

Angular CLI: 19.2.4
Node: 18.20.3
Package Manager: npm 10.2.3
OS: linux x64

Angular: 19.2.3
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, router

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.1902.4
@angular-devkit/core         19.2.4
@angular-devkit/schematics   19.2.4
@angular/build               19.2.4
@angular/cli                 19.2.4
@schematics/angular          19.2.4
rxjs                         7.8.1
typescript                   5.6.3
zone.js                      0.15.0

Anything else?

No response

Activity

  1. changed the title [-]Compile parsing error when using template literal with `@let` or `track`[/-] [+]Compile error when using template literal with `@let` or `track`[/+] on Mar 24, 2025
  2. changed the title [-]Compile error when using template literal with `@let` or `track`[/-] [+]Build error when using template literal with `@let` or `track`[/+] on Mar 24, 2025
  3. self-assigned this
    on Mar 24, 2025
  4. added a commit that references this issue on Mar 24, 2025
    d84a79c
  5. added
    area: compiler
    on Mar 24, 2025
  6. added this to the needsTriage milestone on Mar 24, 2025
  7. added a commit that references this issue on Mar 27, 2025
    8b990a3
  8. Julien-Marcou commented on Apr 1, 2025

    @Julien-Marcou
    Contributor

    @crisbeto it looks this will be released in the next major version of angular only, but I'm encountering this error in v19.2.4, will it be backported to angular v19.2.5?

  9. added a commit that references this issue on Apr 7, 2025
    3441f7b
  10. angular-automatic-lock-bot commented on May 2, 2025

    @angular-automatic-lock-bot

    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.

  11. locked and limited conversation to collaborators on May 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area: compilerstate: has PR

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions