Add user edit form in a block D8 I'm trying to add the user edit form in a block.
I created a custom module

use Drupal\Core\Block\BlockBase;
use Drupal\user\ProfileForm;


class EditUserBlock extends BlockBase{

  /**
   * {@inheritdoc}
   */
  public function build() {

    $form = \Drupal::formBuilder()-&gt;getForm(ProfileForm::class, \Drupal::currentUser());

    return $form;
  }
}


but it doesn't render the form. 

Sorry but I'm pretty new to D8.
This is an entity form and you need EntityFormBuilder::getForm() to build this form. After you have injected the entity form builder and the necessary user storage and current user services in the block plugin:

&lt;?php

namespace Drupal\mymodule\Plugin\Block;

use Drupal\Core\Block\BlockBase;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Core\Entity\EntityFormBuilderInterface;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\Entity\EntityStorageInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;

/**
 * Provides a Profile Block.
 *
 * @Block(
 *  id = "profile_block",
 *  admin_label = @Translation("Profile Block"),
 * )
 */
class ProfileBlock extends BlockBase implements ContainerFactoryPluginInterface {

  /**
   * @var \Drupal\Core\Entity\EntityFormBuilderInterface
   */
  protected $entityFormBuilder;

  /**
   * @var \Drupal\Core\Session\AccountInterface
   */
  protected $currentUser;

  /**
   * @var \Drupal\Core\Entity\EntityStorageInterface
   */
  protected $userStorage;

  public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityFormBuilderInterface $entity_form_builder, AccountInterface $current_user, EntityStorageInterface $user_storage) {
    parent::__construct($configuration, $plugin_id, $plugin_definition);
    $this-&gt;entityFormBuilder = $entity_form_builder;
    $this-&gt;currentUser = $current_user;
    $this-&gt;userStorage = $user_storage;
  }

  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
    return new static(
      $configuration,
      $plugin_id,
      $plugin_definition,
      $container-&gt;get('entity.form_builder'),
      $container-&gt;get('current_user'),
      $container-&gt;get('entity_type.manager')-&gt;getStorage('user')
    );
  }


you can build the profile form for the current user with two lines of code:

  public function build() {
    $user = $this-&gt;userStorage-&gt;load($this-&gt;currentUser-&gt;id());
    return $this-&gt;entityFormBuilder-&gt;getForm($user);
  }

}