<p>This seems to be a <a href="https://github.com/craftcms/cms/issues/4416" rel="nofollow noreferrer">known bug</a> in 3.1.31 and it looks like a fix will be in the next release.</p>

CC BY-SA 4.0
2019-06-26T14:12:32.560Z
2019-06-26T14:12:32.560Z
Dom Stubbs
<p>If you share the full stack trace leading up to that, we can probably see which plugin/module it's coming from.</p>

<p>Otherwise, it's just a deprecation warning and won't really mean anything until Craft 4 comes out.</p>

CC BY-SA 4.0
2019-06-26T23:07:18.047Z
Added the full stack trace in the original post
Garry Burch
CC BY-SA 4.0
2019-06-25T22:36:05.747Z
2019-06-25T22:36:05.747Z
Brad Bell
<p>Message:</p>

<p>The <code>defineComponents</code> event on CraftVariable has been deprecated. Use the <code>init</code> event to register custom components instead.</p>

<p>Origin:</p>

<p>/vendor/craftcms/cms/src/web/twig/Extension.php:1026</p>

<p>Here is the full stack trace:</p>

<pre><code>24  Deprecation error: The `defineComponents` event on CraftVariable has been deprecated. Use the `init` event to register custom components instead. 
Called from /var/www/vhosts/FWS/rcsmillwork.com/vendor/craftcms/cms/src/web/twig/variables/CraftVariable.php:139
23  craft\web\twig\variables\CraftVariable::__construct() 
Called from /var/www/vhosts/FWS/rcsmillwork.com/vendor/craftcms/cms/src/web/twig/Extension.php:1026
22  craft\web\twig\Extension::getGlobals() 
Called from /var/www/vhosts/FWS/rcsmillwork.com/vendor/twig/twig/src/ExtensionSet.php:329
21  Twig\ExtensionSet::getGlobals() 
Called from /var/www/vhosts/FWS/rcsmillwork.com/vendor/twig/twig/src/Environment.php:928
20  craft\web\twig\Environment::getGlobals() 
Called from /var/www/vhosts/FWS/rcsmillwork.com/vendor/twig/twig/src/Environment.php:948
19  craft\web\twig\Environment::mergeGlobals(["entry" =&gt; craft\elements\Entry, "variables" =&gt; ["entry" =&gt; craft\elements\Entry]]) 
Called from /var/www/vhosts/FWS/rcsmillwork.com/vendor/twig/twig/src/Template.php:380
18  __TwigTemplate_4a991a21fa97a9b639ef307d122221fd678770f77eef09c6bb44c40995815346::display(["entry" =&gt; craft\elements\Entry, "variables" =&gt; ["entry" =&gt; craft\elements\Entry]], []) 
Called from /var/www/vhosts/FWS/rcsmillwork.com/vendor/craftcms/cms/src/web/twig/Template.php:34
17  __TwigTemplate_4a991a21fa97a9b639ef307d122221fd678770f77eef09c6bb44c40995815346::display(["entry" =&gt; craft\elements\Entry, "variables" =&gt; ["entry" =&gt; craft\elements\Entry]]) 
Called from /var/www/vhosts/FWS/rcsmillwork.com/vendor/twig/twig/src/Template.php:392
16  __TwigTemplate_4a991a21fa97a9b639ef307d122221fd678770f77eef09c6bb44c40995815346::render(["entry" =&gt; craft\elements\Entry, "variables" =&gt; ["entry" =&gt; craft\elements\Entry]], []) 
Called from /var/www/vhosts/FWS/rcsmillwork.com/vendor/twig/twig/src/TemplateWrapper.php:45
15  Twig\TemplateWrapper::render(["entry" =&gt; craft\elements\Entry, "variables" =&gt; ["entry" =&gt; craft\elements\Entry]]) 
Called from /var/www/vhosts/FWS/rcsmillwork.com/vendor/twig/twig/src/Environment.php:318
14  craft\web\twig\Environment::render("index", ["entry" =&gt; craft\elements\Entry, "variables" =&gt; ["entry" =&gt; craft\elements\Entry]]) 
Called from /var/www/vhosts/FWS/rcsmillwork.com/vendor/craftcms/cms/src/web/View.php:343
13  craft\web\View::renderTemplate("index", ["entry" =&gt; craft\elements\Entry, "variables" =&gt; ["entry" =&gt; craft\elements\Entry]]) 
Called from /var/www/vhosts/FWS/rcsmillwork.com/vendor/craftcms/cms/src/web/View.php:393
12  craft\web\View::renderPageTemplate("index", ["entry" =&gt; craft\elements\Entry, "variables" =&gt; ["entry" =&gt; craft\elements\Entry]]) 
Called from /var/www/vhosts/FWS/rcsmillwork.com/vendor/craftcms/cms/src/web/Controller.php:161
11  craft\controllers\TemplatesController::renderTemplate("index", ["entry" =&gt; craft\elements\Entry, "variables" =&gt; ["entry" =&gt; craft\elements\Entry]]) 
Called from /var/www/vhosts/FWS/rcsmillwork.com/vendor/craftcms/cms/src/controllers/TemplatesController.php:78
10  craft\controllers\TemplatesController::actionRender("index", ["entry" =&gt; craft\elements\Entry, "variables" =&gt; ["entry" =&gt; craft\elements\Entry]])
9   call_user_func_array([craft\controllers\TemplatesController, "actionRender"], ["index", ["entry" =&gt; craft\elements\Entry]]) 
Called from /var/www/vhosts/FWS/rcsmillwork.com/vendor/yiisoft/yii2/base/InlineAction.php:57
8   yii\base\InlineAction::runWithParams(["template" =&gt; "index", "variables" =&gt; ["entry" =&gt; craft\elements\Entry], "p" =&gt; "contact"]) 
Called from /var/www/vhosts/FWS/rcsmillwork.com/vendor/yiisoft/yii2/base/Controller.php:157
7   craft\controllers\TemplatesController::runAction("render", ["template" =&gt; "index", "variables" =&gt; ["entry" =&gt; craft\elements\Entry], "p" =&gt; "contact"]) 
Called from /var/www/vhosts/FWS/rcsmillwork.com/vendor/craftcms/cms/src/web/Controller.php:109
6   craft\controllers\TemplatesController::runAction("render", ["template" =&gt; "index", "variables" =&gt; ["entry" =&gt; craft\elements\Entry], "p" =&gt; "contact"]) 
Called from /var/www/vhosts/FWS/rcsmillwork.com/vendor/yiisoft/yii2/base/Module.php:528
5   craft\web\Application::runAction("templates/render", ["template" =&gt; "index", "variables" =&gt; ["entry" =&gt; craft\elements\Entry], "p" =&gt; "contact"]) 
Called from /var/www/vhosts/FWS/rcsmillwork.com/vendor/craftcms/cms/src/web/Application.php:297
4   craft\web\Application::runAction("templates/render", ["template" =&gt; "index", "variables" =&gt; ["entry" =&gt; craft\elements\Entry], "p" =&gt; "contact"]) 
Called from /var/www/vhosts/FWS/rcsmillwork.com/vendor/yiisoft/yii2/web/Application.php:103
3   craft\web\Application::handleRequest(craft\web\Request) 
Called from /var/www/vhosts/FWS/rcsmillwork.com/vendor/craftcms/cms/src/web/Application.php:286
2   craft\web\Application::handleRequest(craft\web\Request) 
Called from /var/www/vhosts/FWS/rcsmillwork.com/vendor/yiisoft/yii2/base/Application.php:386
1   craft\web\Application::run() 
Called from /var/www/vhosts/FWS/rcsmillwork.com/web/index.php:21```

</code></pre>

<craft3>
Depreceated warning after Craft 3 CMS updated to 3.1.31
# Depreceated warning after Craft 3 CMS updated to 3.1.31

(Asked by: username_0 on 2019-06-25)

Message:
The defineComponents event on CraftVariable has been deprecated. Use the init event to register custom components instead.
Origin:
/vendor/craftcms/cms/src/web/twig/Extension.php:1026
Here is the full stack trace:
24  Deprecation error: The `defineComponents` event on CraftVariable has been deprecated. Use the `init` event to register custom components instead. 
Called from /var/www/vhosts/FWS/rcsmillwork.com/vendor/craftcms/cms/src/web/twig/variables/CraftVariable.php:139
23  craft\web\twig\variables\CraftVariable::__construct() 
Called from /var/www/vhosts/FWS/rcsmillwork.com/vendor/craftcms/cms/src/web/twig/Extension.php:1026
22  craft\web\twig\Extension::getGlobals() 
Called from /var/www/vhosts/FWS/rcsmillwork.com/vendor/twig/twig/src/ExtensionSet.php:329
21  Twig\ExtensionSet::getGlobals() 
Called from /var/www/vhosts/FWS/rcsmillwork.com/vendor/twig/twig/src/Environment.php:928
20  craft\web\twig\Environment::getGlobals() 
Called from /var/www/vhosts/FWS/rcsmillwork.com/vendor/twig/twig/src/Environment.php:948
19  craft\web\twig\Environment::mergeGlobals(["entry" => craft\elements\Entry, "variables" => ["entry" => craft\elements\Entry]]) 
Called from /var/www/vhosts/FWS/rcsmillwork.com/vendor/twig/twig/src/Template.php:380
18  __TwigTemplate_4a991a21fa97a9b639ef307d122221fd678770f77eef09c6bb44c40995815346::display(["entry" => craft\elements\Entry, "variables" => ["entry" => craft\elements\Entry]], []) 
Called from /var/www/vhosts/FWS/rcsmillwork.com/vendor/craftcms/cms/src/web/twig/Template.php:34
17  __TwigTemplate_4a991a21fa97a9b639ef307d122221fd678770f77eef09c6bb44c40995815346::display(["entry" => craft\elements\Entry, "variables" => ["entry" => craft\elements\Entry]]) 
Called from /var/www/vhosts/FWS/rcsmillwork.com/vendor/twig/twig/src/Template.php:392
16  __TwigTemplate_4a991a21fa97a9b639ef307d122221fd678770f77eef09c6bb44c40995815346::render(["entry" => craft\elements\Entry, "variables" => ["entry" => craft\elements\Entry]], []) 
Called from /var/www/vhosts/FWS/rcsmillwork.com/vendor/twig/twig/src/TemplateWrapper.php:45
15  Twig\TemplateWrapper::render(["entry" => craft\elements\Entry, "variables" => ["entry" => craft\elements\Entry]]) 
Called from /var/www/vhosts/FWS/rcsmillwork.com/vendor/twig/twig/src/Environment.php:318
14  craft\web\twig\Environment::render("index", ["entry" => craft\elements\Entry, "variables" => ["entry" => craft\elements\Entry]]) 
Called from /var/www/vhosts/FWS/rcsmillwork.com/vendor/craftcms/cms/src/web/View.php:343
13  craft\web\View::renderTemplate("index", ["entry" => craft\elements\Entry, "variables" => ["entry" => craft\elements\Entry]]) 
Called from /var/www/vhosts/FWS/rcsmillwork.com/vendor/craftcms/cms/src/web/View.php:393
12  craft\web\View::renderPageTemplate("index", ["entry" => craft\elements\Entry, "variables" => ["entry" => craft\elements\Entry]]) 
Called from /var/www/vhosts/FWS/rcsmillwork.com/vendor/craftcms/cms/src/web/Controller.php:161
11  craft\controllers\TemplatesController::renderTemplate("index", ["entry" => craft\elements\Entry, "variables" => ["entry" => craft\elements\Entry]]) 
Called from /var/www/vhosts/FWS/rcsmillwork.com/vendor/craftcms/cms/src/controllers/TemplatesController.php:78
10  craft\controllers\TemplatesController::actionRender("index", ["entry" => craft\elements\Entry, "variables" => ["entry" => craft\elements\Entry]])
9   call_user_func_array([craft\controllers\TemplatesController, "actionRender"], ["index", ["entry" => craft\elements\Entry]]) 
Called from /var/www/vhosts/FWS/rcsmillwork.com/vendor/yiisoft/yii2/base/InlineAction.php:57
8   yii\base\InlineAction::runWithParams(["template" => "index", "variables" => ["entry" => craft\elements\Entry], "p" => "contact"]) 
Called from /var/www/vhosts/FWS/rcsmillwork.com/vendor/yiisoft/yii2/base/Controller.php:157
7   craft\controllers\TemplatesController::runAction("render", ["template" => "index", "variables" => ["entry" => craft\elements\Entry], "p" => "contact"]) 
Called from /var/www/vhosts/FWS/rcsmillwork.com/vendor/craftcms/cms/src/web/Controller.php:109
6   craft\controllers\TemplatesController::runAction("render", ["template" => "index", "variables" => ["entry" => craft\elements\Entry], "p" => "contact"]) 
Called from /var/www/vhosts/FWS/rcsmillwork.com/vendor/yiisoft/yii2/base/Module.php:528
5   craft\web\Application::runAction("templates/render", ["template" => "index", "variables" => ["entry" => craft\elements\Entry], "p" => "contact"]) 
Called from /var/www/vhosts/FWS/rcsmillwork.com/vendor/craftcms/cms/src/web/Application.php:297
4   craft\web\Application::runAction("templates/render", ["template" => "index", "variables" => ["entry" => craft\elements\Entry], "p" => "contact"]) 
Called from /var/www/vhosts/FWS/rcsmillwork.com/vendor/yiisoft/yii2/web/Application.php:103
3   craft\web\Application::handleRequest(craft\web\Request) 
Called from /var/www/vhosts/FWS/rcsmillwork.com/vendor/craftcms/cms/src/web/Application.php:286
2   craft\web\Application::handleRequest(craft\web\Request) 
Called from /var/www/vhosts/FWS/rcsmillwork.com/vendor/yiisoft/yii2/base/Application.php:386
1   craft\web\Application::run() 
Called from /var/www/vhosts/FWS/rcsmillwork.com/web/index.php:21```

**Tags:** craft3


---

## 2 answers

### Answer by username_1 on 2019-06-26. Score: 2 | Accepted answer

This seems to be a [known bug](https://github.com/craftcms/cms/issues/4416) in 3.1.31 and it looks like a fix will be in the next release.


---

### Answer by username_2 on 2019-06-25. Score: 0

If you share the full stack trace leading up to that, we can probably see which plugin/module it's coming from.

Otherwise, it's just a deprecation warning and won't really mean anything until Craft 4 comes out.

> **Comments:**
> **username_0**: Added the full stack trace in the original post  

---

