How do I render the page to add products into my custom module? Here is my code 

&lt;?php
namespace Drupal\mymodule\Controller;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Controller\ControllerBase;
class HelloController extends ControllerBase
{
  public function content() {

       $form = \Drupal::formBuilder()-&gt;getForm('\Drupal\commerce_product\Form\ProductForm');
}
}


I want to render the default add to product page(product/add/default) in my custom module controller file .


  Error: Call to a member function getEntityTypeId() on null in Drupal\Core\Entity\EntityForm->getBaseFormId()  (line 79 of core/lib/Drupal/Core/Entity/EntityForm.php).
You need to create an empty product and use entity.form_builder service to generate the form.
Try the following.

&lt;?php

namespace Drupal\mymodule\Controller;

use Drupal\commerce_product\Entity\Product;
use Drupal\Core\Controller\ControllerBase;

class HelloController extends ControllerBase {
  public function content() {
   $product = Product::create([
     'type' =&gt; 'default',
   ]);
  return  \Drupal::service('entity.form_builder')-&gt;getForm($product);
  }
}