mirror of
https://github.com/grafana/grafana.git
synced 2025-08-06 05:30:12 +08:00
Chore: Prevent preloaded plugins from crashing Grafana (#41490)
* if a plugin fails to load, we will not crash grafana. * preventing the preloaded plugings to crash the whole app on failure. * updated to unkown. * fixed issue with angular by moving the preloadPlugin import to the same row as we did import the importPluginModule.
This commit is contained in:
@ -78,7 +78,6 @@ grafanaRuntime.SystemJS.config({
|
||||
|
||||
function exposeToPlugin(name: string, component: any) {
|
||||
grafanaRuntime.SystemJS.registerDynamic(name, [], true, (require: any, exports: any, module: { exports: any }) => {
|
||||
console.log('registerDynamic callback', name);
|
||||
module.exports = component;
|
||||
});
|
||||
}
|
||||
@ -184,7 +183,7 @@ export async function importPluginModule(path: string, version?: string): Promis
|
||||
if (typeof builtIn === 'function') {
|
||||
return await builtIn();
|
||||
} else {
|
||||
return Promise.resolve(builtIn);
|
||||
return builtIn;
|
||||
}
|
||||
}
|
||||
return grafanaRuntime.SystemJS.import(path);
|
||||
|
Reference in New Issue
Block a user