Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have been developing a few websites using D8 over the past few months. An error message I got a lot was this one:
Twig_Error_Runtime: An exception has been thrown during the rendering of a template ("A stray drupal_render() invocation with $is_root_call = TRUE is causing bubbling of attached assets to break.") in "themes/example/templates/menu.html.twig" at line 36. in Twig_Template->displayWithErrorHandling() (line 328 of core/vendor/twig/twig/lib/Twig/Template.php).
In this case I tried to use an Object of Drupal\Core\Template\Attribute
as the $attributes
paramenter of the Drupal Twig Extension link()
The message doesn't really tell me what went wrong. I think this message appears in a lot of different cases. Can we improve it somehow?
Comments
Comment #1
Lukas von BlarerComment #2
star-szrYou are not alone. I haven't experienced these errors myself but they are coming from render, Twig is just calling render a lot :)