diff -u b/core/lib/Drupal/Core/Extension/ModuleInstaller.php b/core/lib/Drupal/Core/Extension/ModuleInstaller.php --- b/core/lib/Drupal/Core/Extension/ModuleInstaller.php +++ b/core/lib/Drupal/Core/Extension/ModuleInstaller.php @@ -324,9 +324,8 @@ // Now install the module's schema if necessary. drupal_install_schema($module); - // Clear plugin manager caches and flag router to rebuild if requested. + // Clear plugin manager caches. $this->pluginCacheClearer->clearCachedDefinitions(); - $this->routeBuilder->setRebuildNeeded(); // Set the schema version to the number of the last update provided by // the module, or the minimum core schema version. @@ -512,9 +511,8 @@ // its statically cached list. drupal_static_reset('system_rebuild_module_data'); - // Clear plugin manager caches and flag router to rebuild if requested. + // Clear plugin manager caches. $this->pluginCacheClearer->clearCachedDefinitions(); - $this->routeBuilder->setRebuildNeeded(); // Update the kernel to exclude the uninstalled modules. $this->updateKernel($module_filenames);