diff --git a/core/modules/comment/comment.install b/core/modules/comment/comment.install
index c244fe4ce8..54ba30b302 100644
--- a/core/modules/comment/comment.install
+++ b/core/modules/comment/comment.install
@@ -195,3 +195,26 @@ function comment_update_8400() {
   $entity_definition_update_manager = \Drupal::service('entity.definition_update_manager');
   $entity_definition_update_manager->updateFieldStorageDefinition($entity_definition_update_manager->getFieldStorageDefinition('status', 'comment'));
 }
+
+/**
+ * Fix View dependencies.
+ */
+function comment_post_update_new_comments_dependencies() {
+  /** @var array $views */
+  $views = \Drupal::entityTypeManager()->getStorage('view')->loadMultiple();
+
+  /** @var \Drupal\views\Entity\View $view */
+  foreach ($views as $view) {
+    foreach ($view->get('display') as $display_id => $display) {
+      $fields = $display['display_options']['fields'];
+      foreach ($fields as $field) {
+        if ($field['field'] == 'new_comment') {
+          if (!\Drupal::moduleHandler()->moduleExists('history')) {
+            \Drupal::service('module_installer')->install(['history']);
+          }
+        }
+      }
+    }
+    $view->save();
+  }
+}
diff --git a/core/modules/comment/comment.views.inc b/core/modules/comment/comment.views.inc
index 11abede944..8cb5169f92 100644
--- a/core/modules/comment/comment.views.inc
+++ b/core/modules/comment/comment.views.inc
@@ -11,16 +11,18 @@
  * Implements hook_views_data_alter().
  */
 function comment_views_data_alter(&$data) {
-  // New comments are only supported for node table because it requires the
-  // history table.
-  $data['node']['new_comments'] = [
-    'title' => t('New comments'),
-    'help' => t('The number of new comments on the node.'),
-    'field' => [
-      'id' => 'node_new_comments',
-      'no group by' => TRUE,
-    ],
-  ];
+  if (\Drupal::moduleHandler()->moduleExists('history')) {
+    // New comments are only supported for node table because it requires the
+    // history table.
+    $data['node']['new_comments'] = [
+      'title' => t('New comments'),
+      'help' => t('The number of new comments on the node.'),
+      'field' => [
+        'id' => 'node_new_comments',
+        'no group by' => TRUE,
+      ],
+    ];
+  }
 
   // Provide a integration for each entity type except comment.
   foreach (\Drupal::entityManager()->getDefinitions() as $entity_type_id => $entity_type) {
diff --git a/core/modules/comment/src/Plugin/views/field/NodeNewComments.php b/core/modules/comment/src/Plugin/views/field/NodeNewComments.php
index c53b52ed15..5ba5c28d74 100644
--- a/core/modules/comment/src/Plugin/views/field/NodeNewComments.php
+++ b/core/modules/comment/src/Plugin/views/field/NodeNewComments.php
@@ -201,4 +201,13 @@ public function render(ResultRow $values) {
     }
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public function calculateDependencies() {
+    $dependencies = parent::calculateDependencies();
+    $dependencies['module'][] = 'history';
+    return $dependencies;
+  }
+
 }
diff --git a/core/modules/comment/tests/modules/comment_test_views/test_views/views.view.test_new_comments.yml b/core/modules/comment/tests/modules/comment_test_views/test_views/views.view.test_new_comments.yml
index e32997603c..f5629740d7 100644
--- a/core/modules/comment/tests/modules/comment_test_views/test_views/views.view.test_new_comments.yml
+++ b/core/modules/comment/tests/modules/comment_test_views/test_views/views.view.test_new_comments.yml
@@ -3,6 +3,7 @@ status: true
 dependencies:
   module:
     - comment
+    - history
     - node
     - user
 id: '2505879'
diff --git a/core/modules/comment/tests/src/Functional/Views/NodeCommentsTest.php b/core/modules/comment/tests/src/Functional/Views/NodeCommentsTest.php
index e2c5d15ef5..580b02e48e 100644
--- a/core/modules/comment/tests/src/Functional/Views/NodeCommentsTest.php
+++ b/core/modules/comment/tests/src/Functional/Views/NodeCommentsTest.php
@@ -31,6 +31,14 @@ public function testNewComments() {
     $this->assertResponse(200);
     $new_comments = $this->cssSelect(".views-field-new-comments a:contains('1')");
     $this->assertEqual(count($new_comments), 1, 'Found the number of new comments for a certain node.');
+
+    // Test that view displayed when history module disabled.
+    /** @var \Drupal\Core\Extension\ModuleInstallerInterface $module_installer **/
+    $module_installer = \Drupal::service('module_installer');
+    $module_installer->uninstall(['history']);
+    $this->rebuildAll();
+    $this->drupalGet('test-new-comments');
+    $this->assertResponse(404);
   }
 
 }
diff --git a/core/modules/config/tests/src/Functional/ConfigImportAllTest.php b/core/modules/config/tests/src/Functional/ConfigImportAllTest.php
index 4823e6bf07..da08772605 100644
--- a/core/modules/config/tests/src/Functional/ConfigImportAllTest.php
+++ b/core/modules/config/tests/src/Functional/ConfigImportAllTest.php
@@ -114,6 +114,7 @@ public function testInstallUninstall() {
     $this->assertTrue(isset($modules_to_uninstall['comment']), 'The comment module will be disabled');
     $this->assertTrue(isset($modules_to_uninstall['file']), 'The File module will be disabled');
     $this->assertTrue(isset($modules_to_uninstall['editor']), 'The Editor module will be disabled');
+    $this->assertTrue(isset($modules_to_uninstall['history']), 'The History module will be disabled');
 
     // Uninstall all modules that can be uninstalled.
     \Drupal::service('module_installer')->uninstall(array_keys($modules_to_uninstall));
