I placed order and after that same product i had delete after that. When click on view order link from customer order page , below error displayed.

Fatal error: Uncaught TypeError: Argument 1 passed to Magento\Catalog\Block\Product\ImageFactory::create() must be an instance of Magento\Catalog\Model\Product, null given, called in /vendor/magento/module-catalog/Block/Product/ImageBuilder.php on line 135 and defined in /vendor/magento/module-catalog/Block/Product/ImageFactory.php:137 Stack trace: #0 /vendor/magento/module-catalog/Block/Product/ImageBuilder.php(135): Magento\Catalog\Block\Product\ImageFactory->create(NULL, 'cart_page_produ...', Array) #1 /app/code/Module/Sales/Block/Order/Item/Renderer/DefaultRenderer.php(78): Magento\Catalog\Block\Product\ImageBuilder->create(NULL, 'cart_page_produ...', Array) #2 /vendor/magento/module-catalog/Block/Product/ImageFactory.php on line 137

  • It seems to me that you have a customization there located at app/code/Module/Sales/Block/Order/Item/Renderer/DefaultRenderer.php which causes this issue. In the default Magento installation you shouldn't encounter this error. From what I can only guess, that class is a customization of the native vendor/magento/module-sales/Block/Order/Item/Renderer/DefaultRenderer.php possibly added in order to display order item additional info, like the image. – Diana Botean Feb 15 at 16:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.