Stack Exchange
How do I render the page to add products into my custom module?
Here is my code 
<?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()->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).


possible duplicate of https://drupal.stackexchange.com/questions/216480/how-do-i-programmatically-generate-an-entity-form/216484

You need to create an empty product and use entity.form_builder service to generate the form.
Try the following.
<?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' => 'default',
   ]);
  return  \Drupal::service('entity.form_builder')->getForm($product);
  }
}


Thanks @berramou

This code work for me
public function content(Request $request) {
$type = node_type_load("products");
$p = \Drupal\commerce_product\Entity\Product::create([
'type' => 'default',
]);
return  \Drupal::service('entity.form_builder')->getForm($p);

You have set type to default so what is the use of $type = node_type_load("products");
