You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey guys, curious as I am, I just wanted to try out CVA. However, I'm running into problems:
An exception has been thrown during the rendering of a template ("Symfony\UX\TwigComponent\CVA::apply(): Argument #2 must be of type string, null given, called in /var/www/html/vendor/twig/twig/src/Extension/CoreExtension.php on line 1635").
The error happens when I use <twig:Alert /> and do not define any CSS classes. So, to me it looks like attributes.render('class') does not return an empty string but null. Am I doing something wrong or is the documentation incorrect?
{{ alert.apply({color, size}, attributes.render('class')|format) }} fixes the issue temporarily by casting the null to an empty string.
The text was updated successfully, but these errors were encountered:
Hey guys, curious as I am, I just wanted to try out CVA. However, I'm running into problems:
That error happens when trying out CVA as documented here:
https://symfony.com/bundles/ux-twig-component/current/index.html#component-with-complex-variants-cva
The error happens when I use <twig:Alert /> and do not define any CSS classes. So, to me it looks like
attributes.render('class')
does not return an empty string but null. Am I doing something wrong or is the documentation incorrect?{{ alert.apply({color, size}, attributes.render('class')|format) }}
fixes the issue temporarily by casting the null to an empty string.The text was updated successfully, but these errors were encountered: