Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"enable_annotations on the validator cannot be set as Annotations support is disabled" in symfony

I just created a bundle (successfully), and when I am about to create an entity via console this happened(also with clear:cache):

[LogicException]
"enable_annotations" on the validator cannot be set as Annotations support is disabled.

mi config.yml looks like

framework:
    validation: { enable_annotations: true }
    serializer: { enable_annotations: true }

when i comment the options for validation throws the same Exception but with the serializer

when i comment both then it becomes a ServiceNotFoundException

[Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException] The service "routing.loader" has a dependency on a non-existent service "an notation_reader".

What is the problem, I am using symfony 3.3.11

like image 984
Juan I. Morales Pestana Avatar asked Oct 20 '25 22:10

Juan I. Morales Pestana


1 Answers

You also need to enable annotation support in general. This happens automatically as soon as the Doctrine\Common\Annotations\Annotation class is present. For this, you need to make sure to install the doctrine/annotations package.

like image 114
xabbuh Avatar answered Oct 24 '25 05:10

xabbuh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!