From f8026463a8922d12242c4283f02c6ed030c95533 Mon Sep 17 00:00:00 2001 From: Esteban Beltran Date: Wed, 6 Sep 2023 12:49:09 +0200 Subject: [PATCH] Sandbox: Fix plugins not loading due to wrong plugin module url (#74436) --- public/app/features/plugins/sandbox/code_loader.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/app/features/plugins/sandbox/code_loader.ts b/public/app/features/plugins/sandbox/code_loader.ts index e882341b893..dfb94698277 100644 --- a/public/app/features/plugins/sandbox/code_loader.ts +++ b/public/app/features/plugins/sandbox/code_loader.ts @@ -52,7 +52,7 @@ export async function getPluginCode(meta: PluginMeta): Promise { return pluginCode; } else { //local plugin loading - const response = await fetch('public/' + meta.module + '.js'); + const response = await fetch(meta.module); let pluginCode = await response.text(); pluginCode = patchPluginSourceMap(meta, pluginCode); pluginCode = patchPluginAPIs(pluginCode); @@ -81,7 +81,7 @@ function patchPluginSourceMap(meta: PluginMeta, pluginCode: string): string { replaceWith += `//# sourceURL=module.js\n`; } // modify the source map url to point to the correct location - const sourceCodeMapUrl = `/public/${meta.module}.map`; + const sourceCodeMapUrl = meta.module + '.map'; replaceWith += `//# sourceMappingURL=${sourceCodeMapUrl}`; return pluginCode.replace('//# sourceMappingURL=module.js.map', replaceWith);