Kibana version:
6.6.0
Elasticsearch version:
6.6.0
Server OS version:
Ubuntu 18
Browser version:
Chrome 71
Browser OS version:
Ubuntu 18
Original install method (e.g. download page, yum, from source, etc.):
kibana git repo: https://github.com/elastic/kibana.git
Describe the bug:
Kiban left navbar icons disappear when I click my plugin icon.

And they are back again when I click on any of the Kibana plugins

Steps to reproduce:
$ cd kibana
kibana$ node scripts/generate_plugin.js rabbit
? Provide a short description An awesome Kibana plugin
? What Kibana version are you targeting? 6.6.0
? Should an app component be generated? Yes
? Should translation files be generated? Yes
? Should a hack component be generated? Yes
? Should a server API be generated? Yes
? Should SCSS be used? Yes
$ cd ../kibana-extra/rabbit
yarn start
Expected behavior:
All icons on the Kibana left navbar must be visible after I click on my plugin icon.
Screenshots (if relevant):
Look above for the screenshots.
Errors in browser console (if relevant):
No errors.
Any additional context:
cd rabbit
$ cat index.js
import exampleRoute from './server/routes/example';
export default function (kibana) {
return new kibana.Plugin({
require: ['elasticsearch'],
name: 'rabbit',
uiExports: {
app: {
title: 'Rabbit',
description: 'An awesome Kibana plugin',
main: 'plugins/rabbit/app',
},
hacks: [
'plugins/rabbit/hack'
],
styleSheetPaths: require('path').resolve(__dirname, 'public/app.scss'),
},
config(Joi) {
return Joi.object({
enabled: Joi.boolean().default(true),
}).default();
},
init(server, options) { // eslint-disable-line no-unused-vars
// Add server routes and initialize the plugin here
exampleRoute(server);
}
});
}
md5-039123f926f5965a4933a65619de3ff6
$ cat public/app.js
import React from 'react';
import { uiModules } from 'ui/modules';
import chrome from 'ui/chrome';
import { render, unmountComponentAtNode } from 'react-dom';
import 'ui/autoload/styles';
import './less/main.less';
import { Main } from './components/main';
const app = uiModules.get('apps/rabbit');
app.config($locationProvider => {
$locationProvider.html5Mode({
enabled: false,
requireBase: false,
rewriteLinks: false,
});
});
app.config(stateManagementConfigProvider =>
stateManagementConfigProvider.disable()
);
function RootController($scope, $element, $http) {
const domNode = $element[0];
// render react to DOM
render(<Main title="rabbit" httpClient={$http} />, domNode);
// unmount react on controller destroy
$scope.$on('$destroy', () => {
unmountComponentAtNode(domNode);
});
}
chrome.setRootController('rabbit', RootController);
md5-039123f926f5965a4933a65619de3ff6
$ tree -I 'node_modules' -L 30 ../rabbit/
../rabbit/
โโโ index.js
โโโ package.json
โโโ public
โย ย โโโ app.css
โย ย โโโ app.js
โย ย โโโ app.scss
โย ย โโโ components
โย ย โย ย โโโ main
โย ย โย ย โโโ index.js
โย ย โย ย โโโ main.js
โย ย โโโ hack.js
โย ย โโโ less
โย ย โย ย โโโ main.less
โย ย โโโ __tests__
โย ย โโโ index.js
โโโ README.md
โโโ server
โย ย โโโ routes
โย ย โย ย โโโ example.js
โย ย โโโ __tests__
โย ย โโโ index.js
โโโ yarn.lock
Pinging @elastic/kibana-design
Link to the corresponding Discuss item
cc @ryankeairns
Why do I have the icons disappear? How to fix it?
@sergibondarenko can you please try adding import 'ui/autoload/modules'; before the line with import 'ui/autoload/styles'; on your app.js?
@mistic adding import 'ui/autoload/modules'; to the top of my app.js fixed the issue for me. Thanks.
@monfera maybe the generate_plugin.js code should be fixed? I mean, it is bad when you generate a plugin and have UI problems from the start.
ok, I see, it has been fixed already.
@mistic Should we add the line to sao template in kbn-plugin-generator?https://github.com/elastic/kibana/blob/b5b64f4706e824c0df57eb826e110d2005f4a3ec/packages/kbn-plugin-generator/sao_template/template/public/app.js#L6
@johtani yes for sure! I have a PR open for it https://github.com/elastic/kibana/pull/31410
Most helpful comment
@mistic adding
import 'ui/autoload/modules';to the top of my app.js fixed the issue for me. Thanks.