When we try to create module for M2.2 version it missed the below code in Model/{YourModelFIle}.php in constructor.
public function __construct( Context $context, Registry $registry, UploaderPool $uploaderPool, AbstractResource $resource = null, DbCollection $resourceCollection = null, array $data = [] ) { $this->uploaderPool = $uploaderPool; /* this line is missing */ parent::__construct($context, $registry, $resource, $resourceCollection, $data); }
So it create error like Fatal error: Method Magento\Ui\TemplateEngine\Xhtml\Result::__toString() must not throw an exception, caught Error: Call to a member function getUploader() on null in D:\wamp64\www\mage227\vendor\magento\module-ui\Component\Wrapper\UiComponent.php on line 0
It was realy hard time to find what actually causing to occure this.
When we try to create module for M2.2 version it missed the below code in Model/{YourModelFIle}.php in constructor.
public function __construct( Context $context, Registry $registry, UploaderPool $uploaderPool, AbstractResource $resource = null, DbCollection $resourceCollection = null, array $data = [] ) { $this->uploaderPool = $uploaderPool; /* this line is missing */ parent::__construct($context, $registry, $resource, $resourceCollection, $data); }
So it create error like
Fatal error: Method Magento\Ui\TemplateEngine\Xhtml\Result::__toString() must not throw an exception, caught Error: Call to a member function getUploader() on null in D:\wamp64\www\mage227\vendor\magento\module-ui\Component\Wrapper\UiComponent.php on line 0
It was realy hard time to find what actually causing to occure this.