ux icon indicating copy to clipboard operation
ux copied to clipboard

"Cache may be corrupt" when switching from "self closing tag" notation to "container tag" and backslash "\" is in template path

Open Jalliuz opened this issue 4 months ago • 0 comments

I have this TextMessagesButton.php file

#[AsLiveComponent('TextMessagesButton', template: 'Dossier\TextMessagesButton.html.twig')]
final class TextMessagesButton
{}

This works if I use the self closing tag in twig

<twig:TextMessagesButton />

But not when using the container tag notation:

<twig:TextMessagesButton>
    Some content
</twig:TextMessagesButton>

The problem is the backslash in my template path I wrote accidentally "'Dossier\TextMessagesButton.html.twig" with a backslash but it worked with a self-closing tag

The fix is to always use forward slashes in paths of course. The question is, what is the bug, the fact that backslashes work in self closing tags? Or that they don't work in container tags? :) The documentation uses forward slashes

Jalliuz avatar Oct 13 '25 10:10 Jalliuz