Bug while installing debug toolbar in Craft 4 latest version:

An Error occurred while handling another error:
yii\base\NotSupportedException: evaluateDynamicContent() is disallowed. in /craft/vendor/craftcms/cms/src/web/View.php:1884

in /craft/vendor/craftcms/cms/src/web/View.php error is thrown due to 'allowEval' is not set to true?

@throws NotSupportedException unless [[allowEval]] has been set to `true`.

public function evaluateDynamicContent($statements)
    if (!$this->allowEval) {
        throw new NotSupportedException('evaluateDynamicContent() is disallowed.');

    return parent::evaluateDynamicContent($statements);

Also setting $allowEval = true; is not recommended.

References: https://github.com/yiisoft/yii2-debug

How can I resolve this error to start using the debug toolbar?

  • 1
    Yii's debug toolbar is included by default in Craft. You only need to activate it in your user settings. How are you "installing" it?
    – MoritzLost
    Jan 2 at 16:35
  • The craft docs are referencing to the github link. And I have installed it with composer: composer require --prefer-dist yiisoft/yii2-debug I'm new to craft, where do I have to enable this in the user settings? Jan 2 at 16:42
  • Found it. Thank you. Jan 2 at 16:47

1 Answer 1


As the debug toolbar is build-in, you do not have to add it with composer.

You can enable the build-in debug toolbar in the upper right corner on your control panel.

  1. Click on your user account
  2. Tab: preferences
  3. Scroll down to: Development
  4. Check both items under 'Debug Toolbar'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.