Skip to content

Commit 155c65f

Browse files
committed
[mp] fix Uncaught (in promise) undefined
1 parent 56b22d7 commit 155c65f

File tree

1 file changed

+11
-0
lines changed
  • x-pack/plugins/ml/public/application/management/jobs_list

1 file changed

+11
-0
lines changed

x-pack/plugins/ml/public/application/management/jobs_list/index.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@ import { ManagementAppMountParams } from '../../../../../../../src/plugins/manag
1111
import { MlStartDependencies } from '../../../plugin';
1212
import { JobsListPage } from './components';
1313
import { getJobsListBreadcrumbs } from '../breadcrumbs';
14+
import { setDependencyCache, clearCache } from '../../util/dependency_cache';
1415

1516
const renderApp = (element: HTMLElement, coreStart: CoreStart) => {
1617
const I18nContext = coreStart.i18n.Context;
1718
ReactDOM.render(React.createElement(JobsListPage, { I18nContext }), element);
1819
return () => {
1920
unmountComponentAtNode(element);
21+
clearCache();
2022
};
2123
};
2224

@@ -25,6 +27,15 @@ export async function mountApp(
2527
params: ManagementAppMountParams
2628
) {
2729
const [coreStart] = await core.getStartServices();
30+
31+
setDependencyCache({
32+
docLinks: coreStart.docLinks!,
33+
basePath: coreStart.http.basePath,
34+
http: coreStart.http,
35+
i18n: coreStart.i18n,
36+
});
37+
2838
params.setBreadcrumbs(getJobsListBreadcrumbs());
39+
2940
return renderApp(params.element, coreStart);
3041
}

0 commit comments

Comments
 (0)