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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@angular/core:control-flow migration breaks with Greek characters #55085

Closed
XhmikosR opened this issue Mar 28, 2024 · 1 comment
Closed

@angular/core:control-flow migration breaks with Greek characters #55085

XhmikosR opened this issue Mar 28, 2024 · 1 comment
Assignees
Labels
area: migrations Issues related to `ng update` migrations core: control flow Issues related to the built-in control flow (@if, @for, @switch) state: has PR
Milestone

Comments

@XhmikosR
Copy link

XhmikosR commented Mar 28, 2024

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

@angular/core

Is this a regression?

No, never worked right when the template have specific Greek characters

Description

When the template has specific Greek characters in it, the control-flow migration fails consistently; migration done with ng generate @angular/core:control-flow.

Code that reproduces the error:

<ng-container *ngIf="(application$ | async) as application">
  <div class="alert alert-info my-4" role="alert">
    <p class="mb-0">
      Δοκιμή με ελληνικούς χαρακτήρες. θ δ
    </p>
  </div>
</ng-container>

is migrated to:

@if ((application$ | async); as application) {
  <div class="alert alert-info my-4" role="alert">
    <p class="mb-0">
      Δοκιμή με ελληνικούς χαρακτήρες. <ng-template [ngTemplateOutlet]=" "></ng-template>
    </p>
  </div>
}

AFAICT the Greek characters θ and δ confuse the migration.

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

No exception when running the update command, but the generated template changes produce broken code which breaks compilation:

- Changes detected. Rebuilding...

Application bundle generation failed. [0.720 seconds]

✘ [ERROR] NG2: Type 'undefined' is not assignable to type 'TemplateRef<any> | null'. [plugin angular-compiler]

    src/app/components/submission/submission.component.html:4:53:
      4 │ ...�ηνικούς χαρακτήρες. <ng-template [ngTemplateOu...
        ╵                 ~~~~~~~~~~

  Error occurs in the template of component SubmissionComponent.

    src/app/components/submission/submission.component.ts:35:15:
      35 │   templateUrl: './submission.component.html'
         ╵                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 17.3.2
Node: 20.12.0
Package Manager: npm 10.5.0
OS: linux x64

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

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1703.2
@angular-devkit/build-angular   17.3.2
@angular-devkit/core            17.3.2
@angular-devkit/schematics      17.3.2
@angular/cli                    17.3.2
@schematics/angular             17.3.2
rxjs                            7.8.1
typescript                      5.4.3
zone.js                         0.14.4

Anything else?

No response

@JeanMeche JeanMeche added area: migrations Issues related to `ng update` migrations core: control flow Issues related to the built-in control flow (@if, @for, @switch) labels Mar 28, 2024
@ngbot ngbot bot added this to the needsTriage milestone Mar 28, 2024
@crisbeto crisbeto self-assigned this Mar 29, 2024
crisbeto added a commit to crisbeto/angular that referenced this issue Mar 29, 2024
…low migration

The control flow migration was using a couple of Greek letters as placeholders. This ended up conflicting with templates authored in Greek.

These changes use a more obscure placeholder to make conflicts less likely. It also moves the placeholder generation to a centralized function so it's easier to make changes if we decide to update the pattern again.

Fixes angular#55085.
atscott pushed a commit that referenced this issue Mar 29, 2024
…low migration (#55113)

The control flow migration was using a couple of Greek letters as placeholders. This ended up conflicting with templates authored in Greek.

These changes use a more obscure placeholder to make conflicts less likely. It also moves the placeholder generation to a centralized function so it's easier to make changes if we decide to update the pattern again.

Fixes #55085.

PR Close #55113
jessicajaniuk pushed a commit to jessicajaniuk/angular that referenced this issue Mar 29, 2024
…low migration (angular#55113)

The control flow migration was using a couple of Greek letters as placeholders. This ended up conflicting with templates authored in Greek.

These changes use a more obscure placeholder to make conflicts less likely. It also moves the placeholder generation to a centralized function so it's easier to make changes if we decide to update the pattern again.

Fixes angular#55085.

PR Close angular#55113
jessicajaniuk pushed a commit to jessicajaniuk/angular that referenced this issue Mar 29, 2024
…low migration (angular#55113)

The control flow migration was using a couple of Greek letters as placeholders. This ended up conflicting with templates authored in Greek.

These changes use a more obscure placeholder to make conflicts less likely. It also moves the placeholder generation to a centralized function so it's easier to make changes if we decide to update the pattern again.

Fixes angular#55085.

PR Close angular#55113
ilirbeqirii pushed a commit to ilirbeqirii/angular that referenced this issue Apr 6, 2024
…low migration (angular#55113)

The control flow migration was using a couple of Greek letters as placeholders. This ended up conflicting with templates authored in Greek.

These changes use a more obscure placeholder to make conflicts less likely. It also moves the placeholder generation to a centralized function so it's easier to make changes if we decide to update the pattern again.

Fixes angular#55085.

PR Close angular#55113
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Apr 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: migrations Issues related to `ng update` migrations core: control flow Issues related to the built-in control flow (@if, @for, @switch) state: has PR
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants