-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
Component under @defer can not find injected services - R3InjectorError(DeferBlock Injector) error. #56372
Comments
@IgorKurkov thanks for reporting this issue. Could you please create a minimal reproduction scenario (in a form of a Github repository), so that we can perform further investigation? |
@AndrewKushnir do you think it is possible that the inheritance may be problem? I got this error: However... EditorStore is there... in that component. |
Quick update: we've reproduced the issue and found the origin of the problem. I'll be working on a fix, but there is no ETA at this moment. Will keep this thread updated once I have more info. |
…ttached to ApplicationRef This commit updates the logic that create an injector for defer blocks (when it's needed) to account for a situation when a component is instantiated without a connection to the current component tree. This can happen if a component is created using its factory function or via `createComponent()` call. Resolves angular#56372.
…ttached to ApplicationRef This commit updates the logic that create an injector for defer blocks (when it's needed) to account for a situation when a component is instantiated without a connection to the current component tree. This can happen if a component is created using its factory function or via `createComponent()` call. Resolves angular#56372.
…ttached to ApplicationRef (#56763) This commit updates the logic that create an injector for defer blocks (when it's needed) to account for a situation when a component is instantiated without a connection to the current component tree. This can happen if a component is created using its factory function or via `createComponent()` call. Resolves #56372. PR Close #56763
…ttached to ApplicationRef (#56763) This commit updates the logic that create an injector for defer blocks (when it's needed) to account for a situation when a component is instantiated without a connection to the current component tree. This can happen if a component is created using its factory function or via `createComponent()` call. Resolves #56372. PR Close #56763
FYI, the fix for the reported issue has landed and was released to NPM as a part of Angular 18.0.6 packages. Please try updating to Angular 18.0.6 and let us know if the problem still exists. Thank you. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Which @angular/* package(s) are the source of the bug?
core
Is this a regression?
Yes
Description
I'm encountering an issue where the component under @defer block can't achieve injected services in Angular 18.0.2.
However, this issue does not occur when using @if or moving out a component from the @defer { } scope.
unfortunately StackBlitz still buggy and doesn't want to load container with angular v18+, so will provide the example in text here.
Example:
modal root wrapper component for MatDialog:
Modal opening:
this.matDialog.open(ModalHostComponent, { ... parentComponent passing here ... })
parent component HTML
parent component TS:
child: which uses service from modal wrapper component
Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
Please provide the environment you discovered this bug in (run
ng version
)Anything else?
this issue possibly related to this one, but it is different according to newest version and DeferBlock error naming as possibly implemented. #54117
The text was updated successfully, but these errors were encountered: