Skip to main content
corrected spelling, add alternative for prevent running setup:di:compile in developer mode
Source Link

You have an issue at __construct(.

You must pass contextthe context object \Magento\Framework\App\Action\Context $context to the parent class Magento\Framework\App\Action\Action

public function __construct(
\Magento\Framework\App\Action\Context $context,
    CustomHelper $helper
) {
    $this->helper = $helper;
parent::__construct($context);
}

after thisthese changes donot forgot to do Di compile, when in developer mode, just remove the folders under var/generation/ or generated/ as the documentation suggests

or run setup:di:compile when in production mode


You have issue at __construct(.

You must pass context object \Magento\Framework\App\Action\Context $context to parent class Magento\Framework\App\Action\Action

public function __construct(
\Magento\Framework\App\Action\Context $context,
    CustomHelper $helper
) {
    $this->helper = $helper;
parent::__construct($context);
}

after this changes donot forgot to do Di compile

You have an issue at __construct(.

You must pass the context object \Magento\Framework\App\Action\Context $context to the parent class Magento\Framework\App\Action\Action

public function __construct(
\Magento\Framework\App\Action\Context $context,
    CustomHelper $helper
) {
    $this->helper = $helper;
parent::__construct($context);
}

after these changes, when in developer mode, just remove the folders under var/generation/ or generated/ as the documentation suggests

or run setup:di:compile when in production mode


Source Link
Amit Bera
  • 77.7k
  • 20
  • 124
  • 239

You have issue at __construct(.

You must pass context object \Magento\Framework\App\Action\Context $context to parent class Magento\Framework\App\Action\Action

public function __construct(
\Magento\Framework\App\Action\Context $context,
    CustomHelper $helper
) {
    $this->helper = $helper;
parent::__construct($context);
}

after this changes donot forgot to do Di compile