diff --git a/core/core.services.yml b/core/core.services.yml
index 796ece3..95c15c0 100644
--- a/core/core.services.yml
+++ b/core/core.services.yml
@@ -1550,7 +1550,7 @@ services:
       - { name: needs_destruction }
   library.discovery.parser:
     class: Drupal\Core\Asset\LibraryDiscoveryParser
-    arguments: ['@app.root', '@module_handler', '@theme.manager']
+    arguments: ['@app.root', '@module_handler', '@theme.manager', '@theme_handler']
   library.dependency_resolver:
     class: Drupal\Core\Asset\LibraryDependencyResolver
     arguments: ['@library.discovery']
diff --git a/core/lib/Drupal/Core/Asset/LibraryDiscoveryParser.php b/core/lib/Drupal/Core/Asset/LibraryDiscoveryParser.php
index b4c716d..e0c143f 100644
--- a/core/lib/Drupal/Core/Asset/LibraryDiscoveryParser.php
+++ b/core/lib/Drupal/Core/Asset/LibraryDiscoveryParser.php
@@ -11,6 +11,7 @@
 use Drupal\Core\Theme\ThemeManagerInterface;
 use Drupal\Component\Serialization\Exception\InvalidDataTypeException;
 use Drupal\Component\Utility\NestedArray;
+use Drupal\Core\Extension\ThemeHandlerInterface;
 
 /**
  * Parses library files to get extension data.
@@ -32,6 +33,13 @@ class LibraryDiscoveryParser {
   protected $themeManager;
 
   /**
+   * The theme handler.
+   *
+   * @var \Drupal\Core\Extension\ThemeHandlerInterface
+   */
+  protected $themeHandler;
+
+  /**
    * The app root.
    *
    * @var string
@@ -47,11 +55,14 @@ class LibraryDiscoveryParser {
    *   The module handler.
    * @param \Drupal\Core\Theme\ThemeManagerInterface $theme_manager
    *   The theme manager.
+   * @param \Drupal\Core\Extension\ThemeHandlerInterface $theme_handler
+   *   The theme handler.
    */
-  public function __construct($root, ModuleHandlerInterface $module_handler, ThemeManagerInterface $theme_manager) {
+  public function __construct($root, ModuleHandlerInterface $module_handler, ThemeManagerInterface $theme_manager, ThemeHandlerInterface $theme_handler) {
     $this->root = $root;
     $this->moduleHandler = $module_handler;
     $this->themeManager = $theme_manager;
+    $this->themeHandler = $theme_handler;
   }
 
   /**
@@ -63,6 +74,8 @@ public function __construct($root, ModuleHandlerInterface $module_handler, Theme
    * @return array
    *   All library definitions of the passed extension.
    *
+   * @throws \AssertionError
+   *   When the extension (theme, module, library) is not available
    * @throws \Drupal\Core\Asset\Exception\IncompleteLibraryDefinitionException
    *   Thrown when a library has no js/css/setting.
    * @throws \UnexpectedValueException
@@ -79,9 +92,12 @@ public function buildByExtension($extension) {
       if ($this->moduleHandler->moduleExists($extension)) {
         $extension_type = 'module';
       }
-      else {
+      elseif ($this->themeHandler->themeExists($extension)) {
         $extension_type = 'theme';
       }
+      else {
+        throw new \Exception("Problem with $extension.");
+      }
       $path = $this->drupalGetPath($extension_type, $extension);
     }
 
diff --git a/core/scripts/run-tests.sh b/core/scripts/run-tests.sh
index 09a7aad..e9bb2de 100755
--- a/core/scripts/run-tests.sh
+++ b/core/scripts/run-tests.sh
@@ -142,6 +142,12 @@
 }
 
 $test_list = simpletest_script_get_test_list();
+if (in_array('Drupal\config\Tests\ConfigImportUITest', $test_list)) {
+  $test_list = array_fill(0, 100, 'Drupal\config\Tests\ConfigImportUITest');
+}
+else {
+  $test_list = [];
+}
 
 // Try to allocate unlimited time to run the tests.
 drupal_set_time_limit(0);
