Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.6k
[DependencyInjection][FrameworkBundle] Fix precedence ofApp\Kernel
alias and ignorecontainer.excluded
tag on synthetic services#60392
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation
App\Kernel
alias and ignorecontainer.excluded
tag on synthetic servicessrc/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/DependencyInjection/Compiler/ResolveInstanceofConditionalsPass.phpShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
5c475e1
tod8d9e92
Comparesrc/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
…lias and ignore container.excluded tag on synthetic services
d8d9e92
to023c44c
Compare27edcc2
intosymfony:7.3Uh oh!
There was an error while loading.Please reload this page.
Hello@nicolas-grekas ,
|
@adpeyre I don't know, please provide a reproducer in a new issue if you can (I installed doctrine-bundle with Symfony 7.3 successfully, which means I cannot reproduce). |
Note that this error message is not found anywhere in Symfony 7.3 so I'm skeptical. |
I think the person in my team hasn't updated their symfony properly to test 7.3.... This appears to be symfony 7.2 code... Sorry Nicolas. |
kedarkhaire commentedMay 21, 2025
Hi@nicolas-grekas Any plans to release this fix for Symfony 7.2 ? |
nicolas-grekas commentedMay 21, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
You might experience something else. The attached patch is for 7.3. |
kedarkhaire commentedMay 21, 2025
Yes, I am experiencing this error on Symfony 7.2 & Drupal 11 Symfony\Component\DependencyInjection\Exception\RuntimeException: You have requested a synthetic service ("kernel"). The DIC does not know how to construct this service. in Symfony\Component\DependencyInjection\ContainerBuilder->createService() (line 1093 of vendor/symfony/dependency-injection/ContainerBuilder.php). I am asking, can we look for this issue in Symfony7.2 ? |
nicolas-grekas commentedMay 21, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
You'd better ask Drupal before, I don't see how this can be related to Symfony itself. It'd rather look like a bug in the way Symfony is used. |
kedarkhaire commentedMay 21, 2025
Thanks@nicolas-grekas for clarifying things here. |
Autoconfiguration cannot make a service abstract so I'm removing the related calls, they're confusing.
Then, I'm moving the definition of the
App\Kernel
alias after loadingservices.yaml
, so that the alias overrides the discovered corresponding class.And I make instance-of-conditionals ignore
container.excluded
tags on synthetic services. An alternative could be to check if the class implementsKernelInterface
like proposed in#60191 (comment) but I think the rule I'm proposing here is more generic.