Open jacquesbh opened 5 years ago
Thanks @jacquesbh. I've been looking through this, but I find it hard to figure out what is the issue here. I've also reverted to the Symfony docs, and basically it's following the suggestions there: https://symfony.com/doc/current/routing/custom_route_loader.html#using-the-custom-loader. I'm a bit lost where the error is coming from therefore.
@jacquesbh Could you try removing the Exception and letting it load twice? I'm curious what happens to the routing table and performance if the router get's executed twice. Alternative is to see in case it's already loaded, to just return an empty RouteCollection.
Hi!
In your routing you have:
This causes a problem when we make a mistake in our own routing. If so, it returns always this error:
If we comment out the route configuration above, we get the correct error: (as example, in my case)
And this is the same issue everytime we make an error in our config. This is kind of very annoying actually.
Can we try to find a solution to avoid this behavior? What do you think?
Thanks!
How to reproduce
Of course with the sitemap bundle loaded.
In your
config/routes.yaml
, add these lines:Do not create the
toto.yaml
file.Reload and you'll get the error
…Do not add the "sitemap" loader twice in…
.Now, comment the lines in the routing of the bundle like written above in the description. Reload and you get this error:
…The file "toto.yaml" does not exist…
This is much better don't you think? Thanks!