Versions:
PHP: 7.4.33
Twig: 3.11.3
Reproducing
// component/button.twig
<button {{ attributes.merge({ class: 'text-white' }) }}>{{ slot }}</button>
// page.twig
{% x:button with {class:'bg-blue-600'} %} test {% endx %}
Result
<html>
<head>
</head>
<body>test <button class="bg-blue-600 text-white"></button>
</body>
</html>
Solution
When I downgrade to Twig 3.0.5 the code above work as expected.
Versions:
PHP: 7.4.33
Twig: 3.11.3
Reproducing
// page.twig {% x:button with {class:'bg-blue-600'} %} test {% endx %}Result
Solution
When I downgrade to Twig 3.0.5 the code above work as expected.