Problem/Motivation
The menu component (components/menu/menu.twig, line 10) calls drupal_menu(). This Twig function comes from the Twig Tweak module. Twig Tweak is not listed in composer.json or sdc_components.info.yml.
On a site without Twig Tweak, any page that renders the menu component fails with:
Twig\Error\SyntaxError: Unknown "drupal_menu" function in "sdc_components:menu" at line 10.
Steps to reproduce
1. Install SDC Components 2.x on a site without Twig Tweak.
2. Install UI Patterns 2.x with UI Patterns Library.
3. Visit /admin/appearance/ui/components/sdc_components/menu.
4. The page shows "The website encountered an unexpected error".
After enabling Twig Tweak, the page loads.
Found while testing #3639558.
Proposed resolution
Add Twig Tweak as a dependency in composer.json and sdc_components.info.yml.
AI disclosure: I used Claude Code to help find the cause and draft this issue. I reproduced the error myself on Drupal 11.4.11.

| Comment | File | Size | Author |
|---|---|---|---|
| #4 | menu-without-twig-tweak.png | 303.31 KB | anshika agrawal |
| Screenshot 2026-11-23 at 3.42.54 PM.png | 59.32 KB | anshika agrawal |
Comments
Comment #2
flyke commentedThis was the only component that seemed to depend on the twig_tweak module. So I created a custom menu render twig extension and use that, so there is no dependency needed on the twig_tweak module.
Please test if issue is fixed in the latest dev version.
Comment #3
flyke commentedComment #4
anshika agrawal commentedI tested the latest 2.x-dev (commit 14ce9aa, which includes the fix in 00d6421) on Drupal 11.4.11.
Steps:
1. Pulled the latest 2.x.
2. Uninstalled Twig Tweak and cleared the cache.
3. Opened /admin/appearance/ui/components/sdc_components/menu.
Result: the page loads without an error and the menu renders. Before the fix, the same page showed "The website encountered an unexpected error" when Twig Tweak was not installed. No component uses drupal_menu() anymore.
The fix works for me. Thank you for the quick fix!
AI disclosure: I used Claude to help me with the testing steps and to write this comment. I ran the tests myself and checked the results.
Comment #5
flyke commented