Skip to content

[LiveComponent] fails when validation constraints are added #3194

@yoye

Description

@yoye

🐛 Problem Description

After upgrading to Symfony 7.4, my LiveComponent stops working only when validation constraints are added to its properties. It works perfectly without validation constraints.

The issue occurs only when APP_DEBUG=0

It looks like components using validation constraints (Assert, Uuid, etc.) are being excluded or inlined during container compilation.

🔎 Root Cause Suspected

When validation constraints are present, the component receives an additional tag:

validator.attribute_metadata
container.excluded (source: because it's a validator constraint extension)

When constraints are removed, the component works properly.

🔗 Possibly Linked to This PR

This behavior might be related to this change in Symfony 7.4 container compilation:

https://github.com/symfony/symfony/pull/61545/files

It seems related to how validator metadata affects service visibility and autoconfiguration.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions