From b51a998ad98c4fcd338269872c83790cbf28f477 Mon Sep 17 00:00:00 2001
From: Christoph Reiter <reiter.christoph@gmail.com>
Date: Tue, 17 Dec 2019 13:14:34 +0100
Subject: [PATCH] Log an error when getAssetURL() is used before
 initAssetBaseURL()

This is a common source for errors and we currently fall back to a relative path
which happens to work locally but not on the server.
---
 packages/common/utils.js | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/packages/common/utils.js b/packages/common/utils.js
index 99624b4d..7c133605 100644
--- a/packages/common/utils.js
+++ b/packages/common/utils.js
@@ -220,6 +220,8 @@ export const getAssetURL = (path) => {
     // We already found the path before, just go with it
     if (_assetBaseURL) {
         return new URL(path, _assetBaseURL).href;
+    } else {
+        console.error('Using getAssetURL(), but initAssetBaseURL() wasn\'t called yet');
     }
 
     // If all fails we just fall back to relative paths and hope the
-- 
GitLab