Magento 2 How to fix resolve Fatal error: Uncaught Error: Call to a member function setActive() on boolean in magento2


Solution and quick fixes for Magento 2 Fatal error: Uncaught Error: Call to a member function setActive() on boolean in magento2

 The following fatal error occurs in the magento 2. system when we are trying to do some changes or add some new functionalities , after adding the new functionality try to run the terminal commands to delete the cache , module upgrade so that the new changes will reflect on the particular store in magento 2
and run the shell commands


 bin/magento setup:di:compile

 bin/magento setup:static-content:deploy




after running the above command the following error occurs in magento2

 Fatal error: Uncaught Error: Call to a member function setActive() on boolean


Solution :

This can be solved by running the following command in your terminal or shell ssh

You need to be the root directory of magento2 installation



rm -r var/genereated/metadata/global.php


the metadata in the var folder is automatically generated, hence you can delete the above path .


Comments

Popular posts from this blog

Vendor autoload is not found. Please run 'composer install' under application root directory.

Uncaught TypeError: require.config is not a function CSS and Javascript files are not loading after Magento 2 installation

HTTP_RAW_POST_DATA is deprecated from PHP 5.6 onwards and will be removed in PHP 7.0