Skip to content

Conversation

@crisbeto
Copy link
Member

@crisbeto crisbeto commented May 6, 2025

Fixes that the runtime was throwing a DI error when attempting to inject a missing useExisting provider, despite the call being optional.

The problem was that when the provider has useExisting, we do a second inject call under the hood which didn't include the inject flags from the original call.

Fixes #61121.

@crisbeto crisbeto added action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release labels May 6, 2025
@angular-robot angular-robot bot added the area: core Issues related to the framework runtime label May 6, 2025
@ngbot ngbot bot added this to the Backlog milestone May 6, 2025
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the call site that was missing the flags.

Fixes that the runtime was throwing a DI error when attempting to inject a missing `useExisting` provider, despite the call being optional.

The problem was that when the provider has `useExisting`, we do a second `inject` call under the hood which didn't include the inject flags from the original call.

Fixes angular#61121.
@crisbeto crisbeto force-pushed the 61121/use-existing-di branch from bdc06e5 to 970538e Compare May 6, 2025 10:19
@crisbeto
Copy link
Member Author

crisbeto commented May 6, 2025

Passing TGP

@crisbeto crisbeto marked this pull request as ready for review May 6, 2025 14:28
@crisbeto crisbeto requested a review from thePunderWoman May 6, 2025 15:01
Copy link
Contributor

@thePunderWoman thePunderWoman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thePunderWoman thePunderWoman added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels May 6, 2025
@crisbeto crisbeto added target: minor This PR is targeted for the next minor release and removed target: patch This PR is targeted for the next patch release labels May 6, 2025
@AndrewKushnir
Copy link
Contributor

This PR was merged into the repository by commit 583b9a7.

The changes were merged into the following branches: main

@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 Jun 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: core Issues related to the framework runtime target: minor This PR is targeted for the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Optional injection does not handle missing aliased (useExisting) ProviderToken

3 participants