kibana-enhanced-table
kibana-enhanced-table copied to clipboard
Error when building plugin
Hi,
I made some changes on the plugin and I'm facing the following error when trying to build the plugin for Kibana 7.10.2 version:
ERROR in /../elk/7.10.2/kibana/plugins/enhanced_table/kibana.json │ Bundle for [enhancedTable] lists [kibanaUtils, share, charts, visDefaultEditor] as a required bundle, but does not use it. Please remove it.
When I remove these bundles from kibana.json file, I'm able to build the plugin correctly. However, Kibana shows the following error as the bundles were excluded:
ERROR in ./public/data_load/kibana_cloned_code/courier.ts │ Module not found: Error: import [../../../../../src/plugins/kibana_utils/public] references a public export of the [kibanaUtils] bundle, but that bundle is not in the "requiredPlugins" or "requiredBundles" list in the plugin manifest [/../elk/7.10.2/kibana/plugins/enhanced_table/kibana.json] │ @ ./public/data_load/kibana_cloned_code/courier.ts 3:0-85 80:20-39 141:26-45 │ @ ./public/data_load/enhanced-table-request-handler.js │ @ ./public/enhanced-table-vis.js │ @ ./public/plugin.ts │ @ ./public/index.ts │ @ /Users/hamza/Desktop/work/elk/7.10.2/kibana/packages/kbn-optimizer/target/worker/entry_point_creator.js
Could you tell me how you were able to build your packages?
Regards
Yes, I meet this annoying issue. This is how I do for now:
- I use Kibana 7.9 for dev mode
- I generate the plugin package with Kibana 7.9:
- yarn compile
- yarn build
- When I build the plugin (yarn build), I specify 7.10.2 version
- I install generated package on Kibana 7.10.2
I was able to build my plugin package without errors by following your steps. However, when trying to install the plugin, I have this error:
Plugin installation was unsuccessful due to error "No kibana plugins found in archive"
Did you face the same error?
Also when I compare the content of your release (enhanced-table-1.11.0_7.10.2.zip) and what I packaged (my-enhanced-table.zip), these differences are noticed:
# diff enhanced-table-1.11.0_7.10.2.zip my-enhanced-table.zip
Only in kibana/my-enhanced-table/: server
Only in tmp/kibana/enhanced-table/: target
Only in kibana/my-enhanced-table/: translations
Only in kibana/my-enhanced-table/: yarn.lock
Finally I was able to build correctly my plugin with kibana 7.10.2. I made the following steps to do so:
-
Changed package.json by replacing/adding these 2 lignes:
... "build": "yarn plugin-helpers build", "plugin-helpers": "node ../../scripts/plugin_helpers", ...
-
Removed from kibana.json the following lines:
... "requiredBundles": [ "kibanaUtils", "kibanaReact", "share", "charts" ] ...
-
executed
yarn build
`
Thanks for the share! very interesting to know. Happy to see it finally works.
that said, I’m surprised to see yarn plugin-helpers build
.
Do you have a global plugin-helpers
module installed?
No, it's a shorcut to ../../scripts/plugin_helpers. In other words, I have a line in my package.json as follow:
"plugin-helpers": "node ../../scripts/plugin_helpers",
Just to complete the "solution" described in my previous post: the lines "requiredBundles": [ "kibanaUtils", "share", "charts", "visDefaultEditor" ]
must be added in dev mode and removed before to lunch yarn build
. Otherwise, Kibana will not start properly without these lines in dev mode.
Oups, indeed. I misread your previous comment. Thanks again for sharing your feedback. If I have to do breaking changes with Kibana v7.11, I will create a branch and apply what you did.
That said, the change you have to do in package.json
between dev mode and build mode is quite sad. All configuration should be on git, and so, be the same, whatever your action.
I think that it would be nice to open an issue about that on Kibana's repository. Could you do this?
Given that there is no feedback since more than one year, I close the issue.