Closed Surfoo closed 4 years ago
The error says: "you must pass a RoutingConfigurator object, but you passed RouteCollectionBuilder".
But the page you linked to only uses "RoutingConfigurator". We changed this in the page very recently, maybe you were using a previous page version?
No cache issue, I opened the page for the first time yesterday.
The last commit on the rst file is about 3 months ago : https://github.com/symfony/symfony-docs/blob/5.1/configuration/micro_kernel_trait.rst not very recent :thinking:
You are right. This was fixed in #13394 a few months ago.
I was confused by this other PR #13852 from four days ago, which was related to the "RoutingConfigurator" vs "RouteCollectionBuilder" mismatch.
In any case, in the page you linked: https://github.com/symfony/symfony-docs/blob/5.1/configuration/micro_kernel_trait.rst you can see this code:
protected function configureRoutes(RoutingConfigurator $routes)
So, Symfony Docs are using RoutingConfigurator
but the error you showed says "hey, you must use RoutingConfigurator but you are using RouteCollectionBuilder". That's why I don't fully understand the problem.
Here the bug from the browser :
The issue is in MicroKernelTrait.php, right ?
Yes, your code looks right. I still can't understand why this error happens, so I'll ask to the @symfony/team-symfony-docs to see if they can spot the error. Thanks!
Does it help if you rename the method to configureRouting()
?
No, this method doesn't exist anyway in MicroKernelTrait
.
"Kernel" uses "Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait", but does not implement the required method "protected function configureRoutes(RoutingConfigurator $routes): void".
And if you change the use
statement to use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
?
OK, it almost works now.
I have a 404:
Please note that this is not an official support channel. Obviously, there is something wrong in the docs so this doc issue is still valid. However, if you need direct help with issues you're facing, you can get quicker help in one of the support channels: https://symfony.com/support (e.g. Slack or StackOverflow).
Please also note that it has been weekend and this project is almost fully run by volunteers. Things can take a bit longer than paid services :)
You are right, I have been rude in my previous message (deleted now), sorry.
Hello,
I followed the first example A Single-File Symfony Application, just here: https://symfony.com/doc/current/configuration/micro_kernel_trait.html
And it doesn't work, here the log from Symfony CLI:
Can you confirm this bug by reproducing it?