2

I've the run the before running setup:di:compile home page and other is working fine.After running the setup:di:compile expect home page other pages working fine. if i'm removing the di/global.ser that i didn't face any issue but that is correct way.Please help on this i'm not sure what is the issue on that.

Error:

Fatal error: Uncaught TypeError: Argument 1 passed to Magento\Framework\View\Element\Template::__construct() must be an instance of Magento\Framework\View\Element\Template\Context, instance of Magento\Framework\ObjectManager\ObjectManager given, called in E:\xampp\htdocs\Digicel-Branding\vendor\magento\framework\ObjectManager\Factory\AbstractFactory.php on line 93 and defined in E:\xampp\htdocs\Digicel-Branding\vendor\magento\framework\View\Element\Template.php:128 Stack trace: #0 E:\xampp\htdocs\Digicel-Branding\vendor\magento\framework\ObjectManager\Factory\AbstractFactory.php(93): Magento\Framework\View\Element\Template->__construct(Object(Magento\Framework\ObjectManager\ObjectManager)) #1 E:\xampp\htdocs\Digicel-Branding\vendor\magento\framework\ObjectManager\Factory\Compiled.php(88): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Magento\\Framewo...', Array) #2 E:\xampp\htdocs\Digicel-Branding\vendor\magento\framework\ObjectManager\ObjectManager.php(57): Magento\Framework\ObjectManager\Factory in E:\xampp\htdocs\Digicel-Branding\vendor\magento\framework\View\Element\Template.php on line 128

3 Answers 3

2

Execute this command :

  • rm -rf var/ generated/

Then, do process of di:compile.

2
  • you mean to say run steps like step 1: Run the setup:upgrade step 2: rm -rf var/generated step 3: steup:di:compile step 4: static-content:deploy
    – Ramki
    Apr 11, 2018 at 7:03
  • i did the same process but no luck
    – Ramki
    Apr 11, 2018 at 7:15
0

Delete the var/di folder And Upgrade the setup

Then magento will work

5
  • in production mode we need enabled the di:compile if we are removing var/di compile means what is use of compilation
    – Ramki
    Apr 11, 2018 at 6:54
  • before moving to production mode you need to do php -f bin/magento maintenance:enable Apr 11, 2018 at 6:58
  • after moving production "php -f bin/magento maintenance:disable" Apr 11, 2018 at 6:58
  • if You have more doubt check magento2 documentation Apr 11, 2018 at 6:59
  • ok i'm running this command "php bin/magento deploy:mode:set production" this will run all required commands like maintance enable/Disable,upgrade ,deploy .
    – Ramki
    Apr 11, 2018 at 7:01
0

Can you post the __construct from your extend , there seems to be an issue with this. you should have something like

public function __construct(
    \Magento\Backend\Block\Template\Context $context,
    // other dependencies
    array $data = []
)
{
    parent::__construct($context, $data);
    // other declarations
    $this->setTemplate('template_path');
}

This is from a block of mine so in your case it will most likely have to be different

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.