diff --git a/core/modules/comment/comment.post_update.php b/core/modules/comment/comment.post_update.php
new file mode 100755
index 0000000..01c4c0e
--- /dev/null
+++ b/core/modules/comment/comment.post_update.php
@@ -0,0 +1,32 @@
+<?php
+
+/**
+ * @file
+ * Post-update functions for Comment.
+ */
+
+use Drupal\comment\Entity\CommentType;
+use Drupal\comment\CommentTypeInterface;
+
+/**
+ * @addtogroup updates-8.3.x
+ * @{
+ */
+
+/**
+ * Saves the dependency on the entity provider into comment_type entities.
+ */
+function comment_post_update_provider_dependency() {
+  $comment_types = CommentType::loadMultiple();
+  array_walk($comment_types, function (CommentTypeInterface $comment_type) {
+    // Make sure that a definition exists for the target entity. The providing
+    // module may have been uninstalled.
+    if (\Drupal::entityTypeManager()->hasDefinition($comment_type->getTargetEntityTypeId())) {
+      $comment_type->save();
+    }
+  });
+}
+
+/**
+ * @} End of "addtogroup updates-8.3.x".
+ */
diff --git a/core/modules/comment/src/Entity/CommentType.php b/core/modules/comment/src/Entity/CommentType.php
index a773c58..f87a1d8 100644
--- a/core/modules/comment/src/Entity/CommentType.php
+++ b/core/modules/comment/src/Entity/CommentType.php
@@ -99,4 +99,14 @@ public function getTargetEntityTypeId() {
     return $this->target_entity_type_id;
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public function calculateDependencies() {
+    parent::calculateDependencies();
+    $target_entity_type = \Drupal::entityTypeManager()->getDefinition($this->getTargetEntityTypeId());
+    $this->addDependency('module', $target_entity_type->getProvider());
+    return $this;
+  }
+
 }
diff --git a/core/modules/comment/src/Tests/CommentTypeTest.php b/core/modules/comment/src/Tests/CommentTypeTest.php
index 343bb91..d9e3e28 100644
--- a/core/modules/comment/src/Tests/CommentTypeTest.php
+++ b/core/modules/comment/src/Tests/CommentTypeTest.php
@@ -187,4 +187,15 @@ public function testCommentTypeDeletion() {
     $this->assertRaw(t('The comment type %label has been deleted.', ['%label' => $type->label()]));
   }
 
+  /**
+   * Tests that the provider of the target entity is listed as a dependency.
+   */
+  public function testCalculateDependencies() {
+    // Create a comment type programmatically.
+    $comment_type = $this->createCommentType('dep_test');
+    $target_entity_type = \Drupal::entityTypeManager()->getDefinition($comment_type->getTargetEntityTypeId());
+    $dependencies = $comment_type->getDependencies() + ['module' => []];
+    $this->assertTrue(in_array($target_entity_type->getProvider(), $dependencies['module']));
+  }
+
 }
diff --git a/core/modules/comment/src/Tests/Update/CommentUpdateTest.php b/core/modules/comment/src/Tests/Update/CommentUpdateTest.php
index 3db9c4a..e017d8f 100644
--- a/core/modules/comment/src/Tests/Update/CommentUpdateTest.php
+++ b/core/modules/comment/src/Tests/Update/CommentUpdateTest.php
@@ -71,4 +71,23 @@ public function testPublishedEntityKey() {
     $this->assertTrue(\Drupal::database()->schema()->indexExists('comment_field_data', 'comment__status_comment_type'));
   }
 
+  /**
+   * Tests comment_post_update_provider_dependency().
+   *
+   * @see comment_post_update_provider_dependency()
+   */
+  public function testPostUpdateCommentTypeDependencies() {
+    $default_comment_type = 'comment.type.comment';
+
+    // Check that default comment type does not depend on the node module.
+    $dependencies = $this->config($default_comment_type)->get('dependencies.module') ?: [];
+    $this->assertFalse(in_array('node', $dependencies));
+
+    $this->runUpdates();
+
+    // Check that default comment type depends on the node module.
+    $dependencies = $this->config($default_comment_type)->get('dependencies.module') ?: [];
+    $this->assertTrue(in_array('node', $dependencies));
+  }
+
 }
diff --git a/core/modules/comment/tests/src/Kernel/CommentIntegrationTest.php b/core/modules/comment/tests/src/Kernel/CommentIntegrationTest.php
index af73034..feaf51d 100644
--- a/core/modules/comment/tests/src/Kernel/CommentIntegrationTest.php
+++ b/core/modules/comment/tests/src/Kernel/CommentIntegrationTest.php
@@ -37,6 +37,7 @@ protected function setUp() {
     CommentType::create([
       'id' => 'comment',
       'label' => $this->randomString(),
+      'target_entity_type_id' => 'entity_test',
     ])->save();
   }
 
diff --git a/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldFormatterSettingsTest.php b/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldFormatterSettingsTest.php
index dd38569..e8ce508 100644
--- a/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldFormatterSettingsTest.php
+++ b/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldFormatterSettingsTest.php
@@ -42,26 +42,32 @@ protected function setUp() {
     CommentType::create([
       'id' => 'comment_node_page',
       'label' => $this->randomMachineName(),
+      'target_entity_type_id' => 'node',
     ])->save();
     CommentType::create([
       'id' => 'comment_node_article',
       'label' => $this->randomMachineName(),
+      'target_entity_type_id' => 'node',
     ])->save();
     CommentType::create([
       'id' => 'comment_node_blog',
       'label' => $this->randomMachineName(),
+      'target_entity_type_id' => 'node',
     ])->save();
     CommentType::create([
       'id' => 'comment_node_book',
       'label' => $this->randomMachineName(),
+      'target_entity_type_id' => 'node',
     ])->save();
     CommentType::create([
       'id' => 'comment_node_forum',
       'label' => $this->randomMachineName(),
+      'target_entity_type_id' => 'node',
     ])->save();
     CommentType::create([
       'id' => 'comment_node_test_content_type',
       'label' => $this->randomMachineName(),
+      'target_entity_type_id' => 'node',
     ])->save();
 
     NodeType::create([
diff --git a/core/modules/forum/config/optional/comment.type.comment_forum.yml b/core/modules/forum/config/optional/comment.type.comment_forum.yml
index 44a2d65..224982c 100644
--- a/core/modules/forum/config/optional/comment.type.comment_forum.yml
+++ b/core/modules/forum/config/optional/comment.type.comment_forum.yml
@@ -4,6 +4,8 @@ dependencies:
   enforced:
     module:
       - forum
+  module:
+    - node
 id: comment_forum
 label: Comment_forum
 target_entity_type_id: node
diff --git a/core/profiles/standard/config/install/comment.type.comment.yml b/core/profiles/standard/config/install/comment.type.comment.yml
index ddcbbc9..14af64c 100644
--- a/core/profiles/standard/config/install/comment.type.comment.yml
+++ b/core/profiles/standard/config/install/comment.type.comment.yml
@@ -1,6 +1,8 @@
 langcode: en
 status: true
-dependencies: {  }
+dependencies:
+  module:
+    - node
 id: comment
 label: 'Default comments'
 target_entity_type_id: node
