I'm trying to use pattern and component twig function but I got twig error
Steps to reproduce
- Go to any template in your twig templete
- Try to call the component using pattern function:
EX:
{{ pattern('heading', {content: 'Heading title', html_tag: 'h2'}) }}
Error message
Twig\Error\SyntaxError: Unknown "pattern" function. Did you mean "_ui_patterns_normalize_props", "_ui_patterns_preprocess_props"? in Twig\ExpressionParser->getFunction() (line 95 of themes/custom/vardot/components/organisms/nav/nav.twig).
#0 /app/vendor/twig/twig/src/ExpressionParser.php(534): Twig\ExpressionParser->getFunction('pattern', 95)
#1 /app/vendor/twig/twig/src/ExpressionParser.php(323): Twig\ExpressionParser->getFunctionNode('pattern', 95)
#2 /app/vendor/twig/twig/src/ExpressionParser.php(266): Twig\ExpressionParser->parsePrimaryExpression()
#3 /app/vendor/twig/twig/src/ExpressionParser.php(103): Twig\ExpressionParser->getPrimary()
#4 /app/vendor/twig/twig/src/Parser.php(158): Twig\ExpressionParser->parseExpression()
#5 /app/vendor/twig/twig/src/Parser.php(95): Twig\Parser->subparse(NULL, false)
#6 /app/vendor/twig/twig/src/Environment.php(539): Twig\Parser->parse(Object(Twig\TokenStream))
#7 /app/vendor/twig/twig/src/Environment.php(567): Twig\Environment->parse(Object(Twig\TokenStream))
#8 /app/docroot/core/lib/Drupal/Core/Template/TwigEnvironment.php(131): Twig\Environment->compileSource(Object(Twig\Source))
#9 /app/vendor/twig/twig/src/Environment.php(395): Drupal\Core\Template\TwigEnvironment->compileSource(Object(Twig\Source))
#10 /app/vendor/twig/twig/src/Template.php(299): Twig\Environment->loadTemplate('__TwigTemplate_...', 'varbase_compone...', NULL)
#11 /app/vendor/twig/twig/src/Environment.php(407) : eval()'d code(47): Twig\Template->loadTemplate('varbase_compone...', 'themes/custom/v...', 6)
#12 /app/vendor/twig/twig/src/Template.php(387): __TwigTemplate_23baac9769f0938857dd60c49696d829->doDisplay(Array, Array)
#13 /app/vendor/twig/twig/src/Template.php(343): Twig\Template->yield(Array, Array)
#14 /app/vendor/twig/twig/src/Template.php(358): Twig\Template->display(Array)
#15 /app/vendor/twig/twig/src/TemplateWrapper.php(51): Twig\Template->render(Array)
#16 /app/docroot/core/themes/engines/twig/twig.engine(33): Twig\TemplateWrapper->render(Array)
#17 /app/docroot/core/lib/Drupal/Core/Theme/ThemeManager.php(348): twig_render_template('themes/custom/v...', Array)
#18 /app/docroot/core/lib/Drupal/Core/Render/Renderer.php(491): Drupal\Core\Theme\ThemeManager->render('menu__main', Array)
#19 /app/docroot/core/lib/Drupal/Core/Render/Renderer.php(248): Drupal\Core\Render\Renderer->doRender(Array, false)
#20 /app/docroot/core/lib/Drupal/Core/Template/TwigExtension.php(484): Drupal\Core\Render\Renderer->render(Array)
#21 /app/vendor/twig/twig/src/Environment.php(407) : eval()'d code(133): Drupal\Core\Template\TwigExtension->escapeFilter(Object(Drupal\Core\Template\TwigEnvironment), Array, 'html', NULL, true)
#22 /app/vendor/twig/twig/src/Template.php(431): __TwigTemplate_242c4ddd3fd7178b5707d23a2152329e->block_content(Array, Array)
#23 /app/vendor/twig/twig/src/Environment.php(407) : eval()'d code(96): Twig\Template->yieldBlock('content', Array, Array)
#24 /app/vendor/twig/twig/src/Template.php(387): __TwigTemplate_242c4ddd3fd7178b5707d23a2152329e->doDisplay(Array, Array)
#25 /app/vendor/twig/twig/src/Environment.php(407) : eval()'d code(47): Twig\Template->yield(Array)
#26 /app/vendor/twig/twig/src/Template.php(387): __TwigTemplate_5f2611172c14d5a0b38ee4651edfcf27->doDisplay(Array, Array)
#27 /app/vendor/twig/twig/src/Template.php(343): Twig\Template->yield(Array, Array)
#28 /app/vendor/twig/twig/src/Template.php(358): Twig\Template->display(Array)
#29 /app/vendor/twig/twig/src/TemplateWrapper.php(51): Twig\Template->render(Array)
#30 /app/docroot/core/themes/engines/twig/twig.engine(33): Twig\TemplateWrapper->render(Array)
#31 /app/docroot/core/lib/Drupal/Core/Theme/ThemeManager.php(348): twig_render_template('themes/custom/v...', Array)
#32 /app/docroot/core/lib/Drupal/Core/Render/Renderer.php(491): Drupal\Core\Theme\ThemeManager->render('block', Array)
#33 /app/docroot/core/lib/Drupal/Core/Render/Renderer.php(504): Drupal\Core\Render\Renderer->doRender(Array)
#34 /app/docroot/core/lib/Drupal/Core/Render/Renderer.php(248): Drupal\Core\Render\Renderer->doRender(Array, false)
#35 /app/docroot/core/lib/Drupal/Core/Template/TwigExtension.php(484): Drupal\Core\Render\Renderer->render(Array)
#36 /app/vendor/twig/twig/src/Environment.php(407) : eval()'d code(309): Drupal\Core\Template\TwigExtension->escapeFilter(Object(Drupal\Core\Template\TwigEnvironment), Array, 'html', NULL, true)
#37 /app/vendor/twig/twig/src/Template.php(431): __TwigTemplate_0eb47583b3e9f558a3c36f3ecf6fb7b8___510384622->block_navigation(Array, Array)
#38 /app/vendor/twig/twig/src/Environment.php(407) : eval()'d code(124): Twig\Template->yieldBlock('navigation', Array, Array)
#39 /app/vendor/twig/twig/src/Template.php(387): __TwigTemplate_40fba81edece410002dc01e058a7533d->doDisplay(Array, Array)
#40 /app/vendor/twig/twig/src/Environment.php(407) : eval()'d code(256): Twig\Template->yield(Array, Array)
#41 /app/vendor/twig/twig/src/Template.php(387): __TwigTemplate_0eb47583b3e9f558a3c36f3ecf6fb7b8___510384622->doDisplay(Array, Array)
#42 /app/vendor/twig/twig/src/Environment.php(407) : eval()'d code(97): Twig\Template->yield(Array)
#43 /app/vendor/twig/twig/src/Template.php(387): __TwigTemplate_0eb47583b3e9f558a3c36f3ecf6fb7b8->doDisplay(Array, Array)
#44 /app/vendor/twig/twig/src/Environment.php(407) : eval()'d code(58): Twig\Template->yield(Array)
#45 /app/vendor/twig/twig/src/Template.php(387): __TwigTemplate_e2d759426b9ba7c79c3f1e872d5f401a->doDisplay(Array, Array)
#46 /app/vendor/twig/twig/src/Template.php(343): Twig\Template->yield(Array, Array)
#47 /app/vendor/twig/twig/src/Template.php(358): Twig\Template->display(Array)
#48 /app/vendor/twig/twig/src/TemplateWrapper.php(51): Twig\Template->render(Array)
#49 /app/vendor/twig/twig/src/Extension/CoreExtension.php(1482): Twig\TemplateWrapper->render(Array)
#50 /app/vendor/twig/twig/src/Environment.php(407) : eval()'d code(47): Twig\Extension\CoreExtension::include(Object(Drupal\Core\Template\TwigEnvironment), Array, 'varbase_compone...')
#51 /app/vendor/twig/twig/src/Template.php(387): __TwigTemplate_98ce459300ef3a3702235679a4e3d937->doDisplay(Array, Array)
#52 /app/vendor/twig/twig/src/Template.php(343): Twig\Template->yield(Array, Array)
#53 /app/vendor/twig/twig/src/Template.php(358): Twig\Template->display(Array)
#54 /app/vendor/twig/twig/src/TemplateWrapper.php(51): Twig\Template->render(Array)
#55 /app/docroot/core/themes/engines/twig/twig.engine(33): Twig\TemplateWrapper->render(Array)
#56 /app/docroot/core/lib/Drupal/Core/Theme/ThemeManager.php(348): twig_render_template('themes/custom/v...', Array)
#57 /app/docroot/core/lib/Drupal/Core/Render/Renderer.php(491): Drupal\Core\Theme\ThemeManager->render('page', Array)
#58 /app/docroot/core/lib/Drupal/Core/Render/Renderer.php(248): Drupal\Core\Render\Renderer->doRender(Array, false)
#59 /app/docroot/core/lib/Drupal/Core/Template/TwigExtension.php(484): Drupal\Core\Render\Renderer->render(Array)
#60 /app/vendor/twig/twig/src/Environment.php(407) : eval()'d code(102): Drupal\Core\Template\TwigExtension->escapeFilter(Object(Drupal\Core\Template\TwigEnvironment), Array, 'html', NULL, true)
#61 /app/vendor/twig/twig/src/Template.php(387): __TwigTemplate_ad164cc8c17eb6283506f8b9819f958f->doDisplay(Array, Array)
#62 /app/vendor/twig/twig/src/Template.php(343): Twig\Template->yield(Array, Array)
#63 /app/vendor/twig/twig/src/Template.php(358): Twig\Template->display(Array)
#64 /app/vendor/twig/twig/src/TemplateWrapper.php(51): Twig\Template->render(Array)
#65 /app/docroot/core/themes/engines/twig/twig.engine(33): Twig\TemplateWrapper->render(Array)
#66 /app/docroot/core/lib/Drupal/Core/Theme/ThemeManager.php(348): twig_render_template('themes/custom/v...', Array)
#67 /app/docroot/core/lib/Drupal/Core/Render/Renderer.php(491): Drupal\Core\Theme\ThemeManager->render('html', Array)
#68 /app/docroot/core/lib/Drupal/Core/Render/Renderer.php(248): Drupal\Core\Render\Renderer->doRender(Array, false)
#69 /app/docroot/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(158): Drupal\Core\Render\Renderer->render(Array)
#70 /app/docroot/core/lib/Drupal/Core/Render/Renderer.php(638): Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}()
#71 /app/docroot/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(153): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#72 /app/docroot/core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php(90): Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\CurrentRouteMatch))
#73 [internal function]: Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object(Symfony\Component\HttpKernel\Event\ViewEvent), 'kernel.view', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#74 /app/docroot/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func(Array, Object(Symfony\Component\HttpKernel\Event\ViewEvent), 'kernel.view', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#75 /app/vendor/symfony/http-kernel/HttpKernel.php(186): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object(Symfony\Component\HttpKernel\Event\ViewEvent), 'kernel.view')
#76 /app/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#77 /app/docroot/core/lib/Drupal/Core/StackMiddleware/Session.php(53): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#78 /app/docroot/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#79 /app/docroot/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#80 /app/docroot/core/modules/big_pipe/src/StackMiddleware/ContentLength.php(32): Drupal\Core\StackMiddleware\ContentLength->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#81 /app/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php(116): Drupal\big_pipe\StackMiddleware\ContentLength->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#82 /app/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php(90): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#83 /app/vendor/asm89/stack-cors/src/Cors.php(53): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#84 /app/docroot/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Asm89\Stack\Cors->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#85 /app/docroot/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#86 /app/docroot/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#87 /app/docroot/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#88 /app/docroot/core/lib/Drupal/Core/DrupalKernel.php(741): Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#89 /app/docroot/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#90 {main}