I get below error after I do bin/magento setup:upgrade
on my local env. The only workaround I got so far is to run bin/magento setup:di:complile
. After running di compile the error is gone unit I run setup:upgrade again. I am in developer mode.
What is the root problem, and how can I solve it?
1 exception(s): Exception #0 (Magento\Framework\Exception\RuntimeException): Type Error occurred when creating object: Magento\Framework\Config\Dom, Magento\Framework\Config\Dom::__construct(): Argument #2 ($validationState) must be of type Magento\Framework\Config\ValidationStateInterface, null given, called in /data/web/application/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 121
1 exception(s):
Exception #0 (Magento\Framework\Exception\RuntimeException): Type Error occurred when creating object: Magento\Framework\Config\Dom, Magento\Framework\Config\Dom::__construct(): Argument #2 ($validationState) must be of type Magento\Framework\Config\ValidationStateInterface, null given, called in /data/web/application/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 121
Exception #0 (Magento\Framework\Exception\RuntimeException): Type Error occurred when creating object: Magento\Framework\Config\Dom, Magento\Framework\Config\Dom::__construct(): Argument #2 ($validationState) must be of type Magento\Framework\Config\ValidationStateInterface, null given, called in /data/web/application/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 121
<pre>#1 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() called at [vendor/magento/framework/ObjectManager/ObjectManager.php:56]
#2 Magento\Framework\ObjectManager\ObjectManager->create() called at [vendor/magento/framework/Config/DomFactory.php:43]
#3 Magento\Framework\Config\DomFactory->createDom() called at [vendor/magento/framework/View/Model/Layout/Update/Validator.php:141]
#4 Magento\Framework\View\Model\Layout\Update\Validator->isValid() called at [vendor/magento/framework/View/Model/Layout/Merge.php:524]
#5 Magento\Framework\View\Model\Layout\Merge->_validateMergedLayout() called at [vendor/magento/framework/View/Model/Layout/Merge.php:500]
#6 Magento\Framework\View\Model\Layout\Merge->load() called at [generated/code/Hyva/Theme/Framework/View/Model/Layout/Merge/Interceptor.php:149]
#7 Hyva\Theme\Framework\View\Model\Layout\Merge\Interceptor->load() called at [vendor/magento/framework/View/Layout/Builder.php:86]
#8 Magento\Framework\View\Layout\Builder->loadLayoutUpdates() called at [vendor/magento/framework/View/Layout/Builder.php:63]
#9 Magento\Framework\View\Layout\Builder->build() called at [vendor/magento/framework/View/Page/Config.php:227]
#10 Magento\Framework\View\Page\Config->build() called at [vendor/magento/framework/View/Page/Config.php:591]
#11 Magento\Framework\View\Page\Config->getElementAttribute() called at [generated/code/Magento/Framework/View/Page/Config/Interceptor.php:248]
#12 Magento\Framework\View\Page\Config\Interceptor->getElementAttribute() called at [vendor/magento/framework/View/Page/Config.php:549]
#13 Magento\Framework\View\Page\Config->addBodyClass() called at [generated/code/Magento/Framework/View/Page/Config/Interceptor.php:230]
#14 Magento\Framework\View\Page\Config\Interceptor->addBodyClass() called at [vendor/magento/module-catalog/Controller/Category/View.php:246]
#15 Magento\Catalog\Controller\Category\View->execute() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#16 Magento\Catalog\Controller\Category\View\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#17 Magento\Catalog\Controller\Category\View\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#18 Magento\Catalog\Controller\Category\View\Interceptor->___callPlugins() called at [generated/code/Magento/Catalog/Controller/Category/View/Interceptor.php:23]
#19 Magento\Catalog\Controller\Category\View\Interceptor->execute() called at [vendor/magento/framework/App/Action/Action.php:111]
#20 Magento\Framework\App\Action\Action->dispatch() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#21 Magento\Catalog\Controller\Category\View\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#22 Magento\Catalog\Controller\Category\View\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#23 Magento\Catalog\Controller\Category\View\Interceptor->___callPlugins() called at [generated/code/Magento/Catalog/Controller/Category/View/Interceptor.php:32]
#24 Magento\Catalog\Controller\Category\View\Interceptor->dispatch() called at [vendor/magento/framework/App/FrontController.php:245]
#25 Magento\Framework\App\FrontController->getActionResponse() called at [vendor/magento/framework/App/FrontController.php:212]
#26 Magento\Framework\App\FrontController->processRequest() called at [vendor/magento/framework/App/FrontController.php:147]
#27 Magento\Framework\App\FrontController->dispatch() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#28 Magento\Framework\App\FrontController\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#29 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/module-store/App/FrontController/Plugin/RequestPreprocessor.php:99]
#30 Magento\Store\App\FrontController\Plugin\RequestPreprocessor->aroundDispatch() called at [vendor/magento/framework/Interception/Interceptor.php:135]
#31 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/amasty/aminvisiblecaptcha/Plugin/Framework/App/FrontControllerInterface/ValidateCaptcha.php:124]
#32 Amasty\InvisibleCaptcha\Plugin\Framework\App\FrontControllerInterface\ValidateCaptcha->aroundDispatch() called at [vendor/magento/framework/Interception/Interceptor.php:135]
#33 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php:75]
#34 Magento\PageCache\Model\App\FrontController\BuiltinPlugin->aroundDispatch() called at [vendor/magento/framework/Interception/Interceptor.php:135]
#35 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#36 Magento\Framework\App\FrontController\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/App/FrontController/Interceptor.php:23]
#37 Magento\Framework\App\FrontController\Interceptor->dispatch() called at [vendor/magento/framework/App/Http.php:116]
#38 Magento\Framework\App\Http->launch() called at [generated/code/Magento/Framework/App/Http/Interceptor.php:23]
#39 Magento\Framework\App\Http\Interceptor->launch() called at [vendor/magento/framework/App/Bootstrap.php:264]
#40 Magento\Framework\App\Bootstrap->run() called at [pub/index.php:30]
</pre>