Skip to main content

Drupal 8: Devel and Kint

What is not clear when you start developing with drupal 8-9 and using the devel module is that you need the kint vendor php package too. The way devel is build looks like it works without kint, but if you want to take full advangtage of the devel - kint combination while developing you should run an extra composer require command too.

To install Devel using Composer:

composer require drupal/devel

After installing Kint, the "Kint" radio button should be available under "Variables Dumper" in the "Devel Settings" page. If the radio button is not visible, try clearing the caches and refreshing the page.

With information from: https://www.drupal.org/docs/contributed-modules/devel/installation-what…

Your settings.local.php file should have something like this in the end:

// Include Kint class.

include_once(DRUPAL_ROOT . '/modules/contrib/devel/kint/kint/Kint.class.php');
// If debugging is very slow or leads to WSOD reduce the number
// of levels of information shown by Kint.
// Change Kint maxLevels setting:
if (class_exists('Kint')) {
  // Set the maxlevels to prevent out-of-memory. Currently there doesn't seem to be a cleaner way to set this:
  Kint::$maxLevels = 4;
}

 

devel