Problem/Motivation
While using Patterns in views, getting error for the selected component/pattern
Twig\Error\LoaderError: Template "@organisms/card-carousel/_icon-card-carousel.twig" is not defined in "modules/contrib/ui_patterns/templates/patterns-use-wrapper.html.twig" at line 9. in Twig\Loader\ChainLoader->getCacheKey() (line 9 of /var/www/html/docroot/modules/contrib/ui_patterns/templates/patterns-use-wrapper.html.twig).
The name of the template in the error will change according to the chosen pattern/component in the Pattern.
Steps to reproduce
1. Create a view
2. Choose Format and Style as Pattern
3. Choose Pattern in the settings
4. Check the console and error logs
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | test-view-Content-Drupal-Vanilla-09-30-2025_06_27_PM.png | 208.25 KB | prabha1997 |
| #2 | 3548872-twig-error-2.patch | 428 bytes | prashant.c |
Issue fork ui_patterns-3548872
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
prashant.cSubmitting patch to fix the error.
Comment #3
pdureau commentedThanks a lot Prashant. Can you do a MR instead of a patch?
Comment #4
pdureau commentedViews preview: Template is not defined in "patterns-use-wrapper.html.twig"
Comment #5
pdureau commentedI am not familiar with the
use wrappersystem in UI Patterns 1.x. Are you sure the fix needs to be in the Twig template? There is nothing we can do earlier, at PHP level?Comment #8
prabha1997 commented@pdureau

we are getting this issue when ever view preview is enabled in views
After adding the above patch changes issue has been resolved
Comment #9
prabha1997 commentedComment #10
prabha1997 commentedI suggest we have to show this warning message
Pattern Views row plugin does not support preview.instead of error
Comment #11
prabha1997 commented