From 94ddacf836aa3b53e39272bd72ea535835b16f2d Mon Sep 17 00:00:00 2001 From: Mario Jr Date: Thu, 14 Oct 2021 11:13:40 -0300 Subject: [PATCH] fix: allow dynamic import to work when meteor is running with a path When setting "useLocationOrigin: true" and also using a root url like ROOT_URL=http://host:port/mypath , dynamic-import will ignore "mypath" when fetching for files to be imported, resulting in a 404 for these files. To bypass this problem, i changed the code to prepend the "mypath" to the module's URL, before trying to fetch it. Related to #11105. --- packages/dynamic-import/client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/dynamic-import/client.js b/packages/dynamic-import/client.js index f541b38ccf..89a9b0d871 100644 --- a/packages/dynamic-import/client.js +++ b/packages/dynamic-import/client.js @@ -151,7 +151,7 @@ function fetchMissing(missingTree) { var disableLocationOriginIframe = dynamicImportSettings.disableLocationOriginIframe; if (useLocationOrigin && location && !(disableLocationOriginIframe && inIframe())) { - url = location.origin.concat(url); + url = location.origin.concat(__meteor_runtime_config__.ROOT_URL_PATH_PREFIX, url); } else { url = Meteor.absoluteUrl(url); }