You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This worked fine until upgrading to 6.2 (from 6.1) with the following error:
The definition ".service_locator.kV3NDIb" has a reference to an abstract definition "Symfony\Component\Config\Loader\LoaderInterface". Abstract definitions cannot be the target of references.
As I'm not very knowledgable about the inner workings of the service container, this error seemed quite cryptic to me at first. After many hours or debugging and disabling services one by one, I discovered that this error originates from the decorated router service.
This is the full stack trace:
Symfony\Component\DependencyInjection\Exception\RuntimeException:
The definition ".service_locator.kV3NDIb" has a reference to an abstract definition "Symfony\Component\Config\Loader\LoaderInterface". Abstract definitions cannot be the target of references.
at /home/egonolieux/projects/tcgcollector/vendor/symfony/dependency-injection/Compiler/CheckReferenceValidityPass.php:37
at Symfony\Component\DependencyInjection\Compiler\CheckReferenceValidityPass->processValue()
(/home/egonolieux/projects/tcgcollector/vendor/symfony/dependency-injection/Compiler/AbstractRecursivePass.php:80)
at Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass->processValue()
(/home/egonolieux/projects/tcgcollector/vendor/symfony/dependency-injection/Compiler/CheckReferenceValidityPass.php:41)
at Symfony\Component\DependencyInjection\Compiler\CheckReferenceValidityPass->processValue()
(/home/egonolieux/projects/tcgcollector/vendor/symfony/dependency-injection/Compiler/AbstractRecursivePass.php:85)
at Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass->processValue()
(/home/egonolieux/projects/tcgcollector/vendor/symfony/dependency-injection/Compiler/CheckReferenceValidityPass.php:41)
at Symfony\Component\DependencyInjection\Compiler\CheckReferenceValidityPass->processValue()
(/home/egonolieux/projects/tcgcollector/vendor/symfony/dependency-injection/Compiler/AbstractRecursivePass.php:80)
at Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass->processValue()
(/home/egonolieux/projects/tcgcollector/vendor/symfony/dependency-injection/Compiler/CheckReferenceValidityPass.php:41)
at Symfony\Component\DependencyInjection\Compiler\CheckReferenceValidityPass->processValue()
(/home/egonolieux/projects/tcgcollector/vendor/symfony/dependency-injection/Compiler/AbstractRecursivePass.php:80)
at Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass->processValue()
(/home/egonolieux/projects/tcgcollector/vendor/symfony/dependency-injection/Compiler/CheckReferenceValidityPass.php:41)
at Symfony\Component\DependencyInjection\Compiler\CheckReferenceValidityPass->processValue()
(/home/egonolieux/projects/tcgcollector/vendor/symfony/dependency-injection/Compiler/AbstractRecursivePass.php:89)
at Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass->processValue()
(/home/egonolieux/projects/tcgcollector/vendor/symfony/dependency-injection/Compiler/CheckReferenceValidityPass.php:41)
at Symfony\Component\DependencyInjection\Compiler\CheckReferenceValidityPass->processValue()
(/home/egonolieux/projects/tcgcollector/vendor/symfony/dependency-injection/Compiler/AbstractRecursivePass.php:80)
at Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass->processValue()
(/home/egonolieux/projects/tcgcollector/vendor/symfony/dependency-injection/Compiler/CheckReferenceValidityPass.php:41)
at Symfony\Component\DependencyInjection\Compiler\CheckReferenceValidityPass->processValue()
(/home/egonolieux/projects/tcgcollector/vendor/symfony/dependency-injection/Compiler/AbstractRecursivePass.php:44)
at Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass->process()
(/home/egonolieux/projects/tcgcollector/vendor/symfony/dependency-injection/Compiler/Compiler.php:73)
at Symfony\Component\DependencyInjection\Compiler\Compiler->compile()
(/home/egonolieux/projects/tcgcollector/vendor/symfony/dependency-injection/ContainerBuilder.php:721)
at Symfony\Component\DependencyInjection\ContainerBuilder->compile()
(/home/egonolieux/projects/tcgcollector/vendor/symfony/http-kernel/Kernel.php:487)
at Symfony\Component\HttpKernel\Kernel->initializeContainer()
(/home/egonolieux/projects/tcgcollector/vendor/symfony/http-kernel/Kernel.php:709)
at Symfony\Component\HttpKernel\Kernel->preBoot()
(/home/egonolieux/projects/tcgcollector/vendor/symfony/http-kernel/Kernel.php:172)
at Symfony\Component\HttpKernel\Kernel->handle()
(/home/egonolieux/projects/tcgcollector/vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:35)
at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run()
(/home/egonolieux/projects/tcgcollector/vendor/autoload_runtime.php:29)
at require_once('/home/egonolieux/projects/tcgcollector/vendor/autoload_runtime.php')
(/home/egonolieux/projects/tcgcollector/public/index.php:5)
How to reproduce
Simply create a service that decorates the framework router service:
I'm closing as invalid: the class you have implements ServiceSubscriberInterface but provides no injection point for the container. The issue is that the class is autowired, and because you return Router::getSubscribedServices() from getSubscribedServices(), you declare that this class requires a LoaderInterface implementation. There is no such interface to wire.
(I get that the error is a bit cryptic. Not sure how we can improve this.)
Symfony version(s) affected
6.2.*
Description
I have a service that decorates the framework
router
service with the following signature:This worked fine until upgrading to 6.2 (from 6.1) with the following error:
As I'm not very knowledgable about the inner workings of the service container, this error seemed quite cryptic to me at first. After many hours or debugging and disabling services one by one, I discovered that this error originates from the decorated router service.
This is the full stack trace:
How to reproduce
Simply create a service that decorates the framework
router
service:Possible Solution
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: