0

Why am I getting an error that kint is an unknown function?

When I use kint in my twig template, I get the following error:

The website encountered an unexpected error. Please try again later.

Twig\Error\SyntaxError: Unknown "kint" function. in Twig\ExpressionParser->getFunctionNodeClass() (line 96 of themes/custom/fluffy/templates/nodes/node--historical_cat_images.html.twig).
Twig\ExpressionParser->getFunctionNode('kint', 96) (Line: 235)
Twig\ExpressionParser->parsePrimaryExpression() (Line: 175)
Twig\ExpressionParser->getPrimary() (Line: 70)
Twig\ExpressionParser->parseExpression() (Line: 142)
Twig\Parser->subparse(NULL, ) (Line: 98)
Twig\Parser->parse(Object) (Line: 563)
Twig\Environment->parse(Object) (Line: 595)
Twig\Environment->compileSource(Object) (Line: 408)
Twig\Environment->loadClass('__TwigTemplate_d5b278350c4def17738543ca20480b532effadcdfc825b13713ee45ee867f82b', 'themes/custom/fluffy/templates/nodes/node--historical_cat_images.html.twig', NULL) (Line: 381)
Twig\Environment->loadTemplate('themes/custom/fluffy/templates/nodes/node--historical_cat_images.html.twig') (Line: 65)
twig_render_template('themes/custom/fluffy/templates/nodes/node--historical_cat_images.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('node', Array) (Line: 431)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 200)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 226)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 573)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 227)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 117)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object) (Line: 78)
Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy->dispatch(Object, 'kernel.view') (Line: 163)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 80)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 705)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

I am using Drupal 9.0.1. and have, among other things, this in my composer.json file:

"require-dev": {
    "drupal/devel": "^4.0",
    "drupal/devel_php": "^1.2",
    "kint-php/kint": "^3.3"
}

In my services.yml file, I have:

twig.config:
  debug: true,

And in the twig file I have:

{{ kint() }}

I also have the Variables Dumper set to Kint in the Devel config.

  • Since the Kint module has been removed from Devel the Kint extension also has been removed. I don't think there's a replacement yet. – leymannx Jul 2 at 15:18
  • 4
    I’m voting to close this question because it's a known issue that's currently been worked on, see gitlab.com/drupalspoons/devel/-/issues/320 – leymannx Jul 2 at 15:22
  • Thanks, leymannx. I spent way too much time Googling without finding the link that you provided. Feel free to close. – kosher Jul 2 at 17:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.