diff --git a/src/AssetInjectorInterface.php b/src/AssetInjectorInterface.php
index 1d421fd..a7a8cb8 100644
--- a/src/AssetInjectorInterface.php
+++ b/src/AssetInjectorInterface.php
@@ -40,6 +40,9 @@ interface AssetInjectorInterface extends ConfigEntityInterface {
   /**
    * Get file path relative to drupal root to use in library info.
    *
+   * For now, we have to local stream wrappers this to a path relative to Drupal
+   * root, until https://www.drupal.org/project/drupal/issues/2735717 is fixed.
+   *
    * @return string
    *   File path relative to drupal root, with leading slash.
    */
diff --git a/src/Entity/AssetInjectorBase.php b/src/Entity/AssetInjectorBase.php
index b9dd7e6..9f63ef7 100644
--- a/src/Entity/AssetInjectorBase.php
+++ b/src/Entity/AssetInjectorBase.php
@@ -8,6 +8,7 @@ use Drupal\Core\Config\Entity\ConfigEntityBase;
 use Drupal\Core\Entity\EntityStorageInterface;
 use Drupal\Core\Entity\EntityWithPluginCollectionInterface;
 use Drupal\Core\Condition\ConditionPluginCollection;
+use Drupal\Core\StreamWrapper\LocalStream;
 
 /**
  * Class AssetInjectorBase: Base asset injector class.
@@ -72,6 +73,13 @@ abstract class AssetInjectorBase extends ConfigEntityBase implements AssetInject
    */
   protected $conditionPluginManager;
 
+  /**
+   * The stream wrapper manager.
+   *
+   * @var \Drupal\Core\StreamWrapper\StreamWrapperManagerInterface
+   */
+  private $streamWrapperManager;
+
   /**
    * {@inheritdoc}
    */
@@ -102,9 +110,14 @@ abstract class AssetInjectorBase extends ConfigEntityBase implements AssetInject
    * {@inheritdoc}
    */
   public function filePathRelativeToDrupalRoot() {
-    $path = \Drupal::service('file_url_generator')
-      ->generateAbsoluteString($this->internalFileUri());
-    return str_replace(base_path(), '/', parse_url($path, PHP_URL_PATH));
+    $fileUri = $this->internalFileUri();
+    $wrapper = $this->getStreamWrapperManager()->getViaUri($fileUri);
+    if ($wrapper instanceof LocalStream) {
+      $publicPath = $wrapper->getDirectoryPath();
+      $targetPath = $this->streamWrapperManager->getTarget($fileUri);
+      return "/$publicPath/$targetPath";
+    }
+     return $fileUri;
   }
 
   /**
@@ -205,4 +218,16 @@ abstract class AssetInjectorBase extends ConfigEntityBase implements AssetInject
     return $this->conditionPluginManager;
   }
 
+  /**
+   * Gets the stream wrapper manager.
+   *
+   * @return \Drupal\Core\StreamWrapper\StreamWrapperManagerInterface
+   */
+  public function getStreamWrapperManager() {
+    if (!isset($this->streamWrapperManager)) {
+      $this->streamWrapperManager = \Drupal::service('stream_wrapper_manager');
+    }
+    return $this->streamWrapperManager;
+  }
+
 }
