mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Sandbox: Fix sandbox not loading SystemJs.module objects correctly inside plugins (#74445)
This commit is contained in:
parent
4a4f759b2a
commit
ae858fcdd2
@ -2,4 +2,4 @@
|
||||
* Map with all dependencies that are exposed to plugins sandbox
|
||||
* e.g.: @grafana/ui, @grafana/data, etc...
|
||||
*/
|
||||
export const sandboxPluginDependencies = new Map<string, unknown>([]);
|
||||
export const sandboxPluginDependencies = new Map<string, System.Module>([]);
|
||||
|
@ -189,7 +189,11 @@ function resolvePluginDependencies(deps: string[]) {
|
||||
// resolve dependencies
|
||||
const resolvedDeps: CompartmentDependencyModule[] = [];
|
||||
for (const dep of deps) {
|
||||
const resolvedDep = sandboxPluginDependencies.get(dep);
|
||||
let resolvedDep = sandboxPluginDependencies.get(dep);
|
||||
if (resolvedDep?.__useDefault) {
|
||||
resolvedDep = resolvedDep.default;
|
||||
}
|
||||
|
||||
if (!resolvedDep) {
|
||||
throw new Error(`[sandbox] Could not resolve dependency ${dep}`);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user