flex: [Bug] Can't load routing via annotations
If I uncomment this in the default /etc/routing.yaml:
controllers:
resource: ../src/Controller/
type: annotation
And create a src/Controller/DefaultController.php with the appropriate annotations, I see this error:

But this should work after this change: https://github.com/symfony/symfony/pull/21231
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 1
- Comments: 19 (11 by maintainers)
@AxelBriche, in my case I had forgotten the
.htaccess, which is not created by default with symfony/flex. Posted a complete answer here: https://stackoverflow.com/a/49209861/2761700@darius-v
composer req annotationsI created a pr to the docs to add the install line.
Hello, I have this error:
composer req annotationsannotations.yaml
routes.yaml
MessageController.php
php bin/console debug:routershow the route:But the route /message doesn’t work.
Another routing problem:
Note: It’s a clean new Flex installation, I have followed the official doc. Note2: I have run: composer require sensio/framework-extra-bundle, already installed.