Kibana 8.8.0 - External plugins not running on Kibana Docker images (production)

hey, Kibana experts

I'm experiencing an issue where external plugins are not able to run within Kibana Docker images. I have followed the necessary steps to set up an empty plugin using an open GraphQL API, the latest version of the GraphQL library, and Apollo Client. The plugin works as expected when running Kibana in my development environment using "yarn kbn bootstrap," "yarn start" on Kibana, and "yarn dev" for the plugin.

However, when I build the external plugin using "yarn build" and try to install it on a Kibana Docker image, the plugin fails to render, and I encounter errors in the console. To reproduce the issue, you can refer to the following repository: GitHub - brenoandrade-wdrv/kibana-8.8.0-graphql-issue at 8.8.0

Refer to the screenshots:

core.entry.js:1 TypeError: Cannot read properties of undefined (reading 'call')
at o (kbn-ui-shared-deps-npm.dll.js:1:388)
at Object. (wind.chunk.1.js:1:114734)
at o (wind.plugin.js:1:361)
at Object. (wind.chunk.1.js:1:62027)
at o (wind.plugin.js:1:361)
at Object. (wind.chunk.1.js:1:284050)
at o (wind.plugin.js:1:361)
at Object. (wind.chunk.1.js:1:14866)
at o (wind.plugin.js:1:361)
at Module. (wind.chunk.1.js:1:399478)

The same approach works successfully on Kibana version 8.6.2, as demonstrated in this repository: GitHub - brenoandrade-wdrv/kibana-8.8.0-graphql-issue at 8.6.2

Upon investigating, I noticed the following commit in the Kibana repository, which might be the cause of the issue:

I am unsure whether this commit is related to the problem, but it appears suspicious.

I kindly request assistance in resolving this issue to enable the proper functioning of external plugins (using third-party libraries) within Kibana production envs.

Much appreciated

The issue is related to the NODE_ENV environment stuff.

From this change:

They've kept the packages: 'kbn-ui-shared-deps-npm' and 'kbn-ui-shared-deps-src' using bazel and they've managed the webpack modules by applying the NODE_ENV environment variable.

Not sure how to manage this, I've tried to manage on Dockerfiles before installing the plugin and it hasn't worked.

By reverting the webpack.config.js under those Kibana packages and building the plugin I've got the plugin working again:

image

How should external plugins approach this environment in order to ship Kibana?

The fix will be available on Kibana 8.9.0

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.