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

Control flow migration fails for async pipe with unboxing of observable. #52756

Closed
sfabriece opened this issue Nov 9, 2023 · 4 comments
Closed
Labels
area: migrations Issues related to `ng update` migrations core: control flow Issues related to the built-in control flow (@if, @for, @switch)
Milestone

Comments

@sfabriece
Copy link

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

core

Is this a regression?

Yes

Description

I run the control flow migration on my code and it failed compilation.

before:
<ng-container *ngIf="value$ | async; let value">
{{value}}

after:
@if (value$ | async; let value) {
{{value}}
}

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

Property 'value' does not exist on type 'Page'. Did you mean 'value$'?

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

Angular CLI: 17.0.0
Node: 20.9.0
Package Manager: yarn 1.22.19
OS: win32 x64

Angular: 17.0.1
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic    
... router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1700.0
@angular-devkit/build-angular   17.0.0
@angular-devkit/core            17.0.0
@angular-devkit/schematics      17.0.0
@angular/cdk                    17.0.0
@angular/cli                    17.0.0
@schematics/angular             17.0.0
rxjs                            7.8.1
typescript                      5.2.2
zone.js                         0.14.2

Anything else?

No response

@sfabriece sfabriece changed the title Control flow migration failes for async pipe with unboxing of observable. Control flow migration fails for async pipe with unboxing of observable. Nov 9, 2023
@pkozlowski-opensource pkozlowski-opensource added area: migrations Issues related to `ng update` migrations core: control flow Issues related to the built-in control flow (@if, @for, @switch) labels Nov 9, 2023
@ngbot ngbot bot added this to the needsTriage milestone Nov 9, 2023
@AnthonyFr75
Copy link
Contributor

Hi,
Could you assign it to me ?

@alxhub
Copy link
Member

alxhub commented Nov 12, 2023

The issue is that the migration should be producing as value not let value.

@AnthonyFr75
Copy link
Contributor

AnthonyFr75 commented Nov 12, 2023

Ok 👍 I think I got the fix

AnthonyFr75 added a commit to AnthonyFr75/forkedAngular that referenced this issue Nov 20, 2023
…oxing of observable

Update control flow syntax to use 'as' for proper async pipe handling, accounting for variable whitespace before 'let'.

Fixes angular#52756
AnthonyFr75 added a commit to AnthonyFr75/forkedAngular that referenced this issue Nov 20, 2023
…oxing of observable (angular#52756)

Update control flow syntax to use 'as' for proper async pipe handling, accounting for variable whitespace before 'let'.

Fixes angular#52756
AndrewKushnir pushed a commit that referenced this issue Nov 20, 2023
…oxing of observable (#52756) (#52972)

Update control flow syntax to use 'as' for proper async pipe handling, accounting for variable whitespace before 'let'.

Fixes #52756

PR Close #52972
tbondwilkinson pushed a commit to tbondwilkinson/angular that referenced this issue Dec 6, 2023
…oxing of observable (angular#52756) (angular#52972)

Update control flow syntax to use 'as' for proper async pipe handling, accounting for variable whitespace before 'let'.

Fixes angular#52756

PR Close angular#52972
@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 Dec 21, 2023
ChellappanRajan pushed a commit to ChellappanRajan/angular that referenced this issue Jan 23, 2024
…oxing of observable (angular#52756) (angular#52972)

Update control flow syntax to use 'as' for proper async pipe handling, accounting for variable whitespace before 'let'.

Fixes angular#52756

PR Close angular#52972
rlmestre pushed a commit to rlmestre/angular that referenced this issue Jan 26, 2024
…oxing of observable (angular#52756) (angular#52972)

Update control flow syntax to use 'as' for proper async pipe handling, accounting for variable whitespace before 'let'.

Fixes angular#52756

PR Close angular#52972
amilamen pushed a commit to amilamen/angular that referenced this issue Jan 26, 2024
…oxing of observable (angular#52756) (angular#52972)

Update control flow syntax to use 'as' for proper async pipe handling, accounting for variable whitespace before 'let'.

Fixes angular#52756

PR Close angular#52972
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)
Projects
None yet
4 participants