Skip to main content

No serializer service found

The bundle requires symfony/serializer, which is installed as a Composer dependency. However, the serializer service alias is only registered when framework-bundle enables it. If your app doesn’t enable the framework-bundle serializer, add the following to config/packages/framework.yaml:
YAML
framework:
  serializer:
    enabled: true
In most cases, it’s better to let the framework-bundle register the serializer for you rather than defining the service by hand.

The Groups attribute wasn’t taken into account

If your #[Groups(['searchable'])] attributes aren’t being applied at index time, check these in order:
  1. The bundle’s per-index serializer-groups flag is on. This is the most common cause — it defaults to false. Set it in your algolia_search configuration:
YAML
algolia_search:
  indices:
    - name: posts
      class: App\Entity\Post
      enable_serializer_groups: true
Without this flag, the bundle normalizes entities without passing the searchable group to the Symfony serializer, so #[Groups] filtering never activates.
  1. Symfony attribute serialization is enabled. This is the default on Symfony 7 and later. If your app explicitly disabled it, re-enable it in config/packages/framework.yaml:
YAML
framework:
  serializer:
    enable_attributes: true
  1. The #[Groups] attribute uses the current namespace. Import Symfony\Component\Serializer\Attribute\Groups, not the legacy Annotation\Groups.
Last modified on April 27, 2026