-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Plugins] Problem with building plugins in 8.7.0 #154325
Comments
Pinging @elastic/kibana-operations (Team:Operations) |
I'm encountering the same issue when trying to upgrade our plugins so that we can upgrade our stack to 8.7.0. |
We will spend time looking into this once we get a chance on our backlog. Thanks for reporting this 👍 |
I've spent time looking at this issue and found out that the problem is fixed for 8.8 and onwards. I will investigate how much work would be to fix this for 8.7 (but I anticipate it is not trivial at this point). As a workaround I would say you can use the Kibana 8.8 branch to build your plugins for v8.7.0 🙂 |
I didn't realize that kibana could load plugins built by a different version of kibana. It seems like I had trouble with that in the past, but I'll give it a try and let you know what I find. |
@andrewthad when running Let me know what you find out after trying it 👍 |
Thank you @mistic I have tried it looks like in But there is another one. For plugin.ts setup: ...
public setup(core: CoreSetup): PluginNamePluginSetup {
// Register an application into the side navigation menu
core.application.register({
id: 'pluginName',
title: PLUGIN_NAME,
async mount(params: AppMountParameters) {
// Load application bundle
const { renderApp } = await import('./application'); // <--- THIS LINE
... I get error: For older version in this chunk I have number insted of path something like this:
Other plugins in kibana instance looks similar e.g:
Do I forgot about something? I have done similar action like for
After build there is also a path in exports:
|
@Karql I just realised that on the previous workaround , and in more complex plugin scenarios, due to the way we static link and map shared dependencies this error could occur. I think I was able to successfully fix the problem for 8.7. I believe if you checkout now the latest head from Kibana 8.7 branch and build your plugin for 8.7.x against it this problem is now fixed. Let me know about it 🤞 |
I was able to use |
@mistic still the same. I have checkout to After build chunk contains path in Tested also for |
@Karql that detail in the chunk is not important is just a part of how we static link against single version dependencies we ship and bundle with Kibana using a DLL. I just tried to build the searchExample you mentioned against the latest head in |
@mistic my mistake I have thought that path is the problem. Here is it: elastalertKibanaPlugin-8.7.1.zip You can use any settings e.g.:
to check only is pluging will loading. Here is source code: https://github.com/Karql/elastalert-kibana-plugin/tree/build-issue |
We have similar issues in 8.7.1. This was working in 8.6.2
|
Hi @mistic ! Probably I have found the problem. Problem occurs when plugin code contains properties in class. Simplified example: // ./public/components/bar/bar.tsx
import React, { Component } from 'react';
export class Bar extends Component {
private bar = "foo"; // Not working with this line :(
render() {
return (
<div>bar component</div>
);
}
} // ./public/components/bar/index.ts
export { Bar } from './bar';
// ./public/components/app.tsx
...
import { Bar } from './bar'
...
</EuiText>
<Bar></Bar>
</EuiPageContentBody>
...
After these steps when I try to run plugin in kibana I recieve error: When there is no property in component - plugin launches correctly. IMO in chunk instead of When I put brake point in this export: and call Here is plugin after build: fooPlugin-8.8.0.zip How to deal with this? Best regards, |
We have the same issue with Kibana 8.8.0 and 8.8.1. Our build results with same error as mentioned above. @mistic Any idea on how this can fixed? Thank you, |
I'm also getting `Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution. module.exports = (webpack_require(/! dll-reference kbnSharedDeps_npm / "dll-reference kbnSharedDeps_npm"))("../../node_modules/webpack/buildin/global.js"); |
The issue is related to the NODE_ENV environment stuff. From this change: afb09cc#diff-e2954b558f2aa82baff0e30964490d12942e0e251c1aa56c3294de6ec67b7cf5 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. (i.g., I've reverted the mode to be 'production' hard-coded) How should external plugins approach this environment in order to ship Kibana? |
@brenoandrade-wdrv could you please provide an example plugin that when building with the current settings builds correctly and is then erroring out when trying to load it in production on the page? I will try to look at this next week |
Hi @mistic You can check out from these repositories: https://github.com/brenoandrade-wdrv/graphql-plugin-example/tree/8.8.0 (Minimalist plugin using apollo-client / graphQL) https://github.com/brenoandrade-wdrv/kibana-8.8.0-graphql-issue/tree/8.8.0 (Docker compose approaching production environment) Note: There's also 8.6.2 branch that works properly by applying the same approach. Thanks, Breno. |
…ode (#159630) Closes #159328 , #154325, #157440 This PR fixes a problem in the plugin helpers tasks used to build external plugins. After changes to transpile packages differently in the past months a bug was introduced and external plugins were being built with the wrong shared ui deps output mode causing development form imports to be bundled and causing problems at page load time. --------- Co-authored-by: kibanamachine <[email protected]>
…ode (#159630) Closes #159328 , #154325, #157440 This PR fixes a problem in the plugin helpers tasks used to build external plugins. After changes to transpile packages differently in the past months a bug was introduced and external plugins were being built with the wrong shared ui deps output mode causing development form imports to be bundled and causing problems at page load time. --------- Co-authored-by: kibanamachine <[email protected]> (cherry picked from commit 7e067ec)
…ode (#159630) Closes #159328 , #154325, #157440 This PR fixes a problem in the plugin helpers tasks used to build external plugins. After changes to transpile packages differently in the past months a bug was introduced and external plugins were being built with the wrong shared ui deps output mode causing development form imports to be bundled and causing problems at page load time. --------- Co-authored-by: kibanamachine <[email protected]> (cherry picked from commit 7e067ec)
…tput mode (#159630) (#159760) # Backport This will backport the following commits from `main` to `8.7`: - [fix(NA): build external plugins with correct bazel artifacts output mode (#159630)](#159630) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Tiago Costa","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-06-14T23:43:05Z","message":"fix(NA): build external plugins with correct bazel artifacts output mode (#159630)\n\nCloses #159328 ,\r\nhttps://github.com//issues/154325,\r\nhttps://github.com//issues/157440\r\n\r\nThis PR fixes a problem in the plugin helpers tasks used to build\r\nexternal plugins. After changes to transpile packages differently in the\r\npast months a bug was introduced and external plugins were being built\r\nwith the wrong shared ui deps output mode causing development form\r\nimports to be bundled and causing problems at page load time.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"7e067ec47866007051be6afad2a46ab9f8438cb7","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["chore","Team:Operations","release_note:skip","auto-backport","v8.7.2","v8.9.0","v8.8.2"],"number":159630,"url":"https://github.com/elastic/kibana/pull/159630","mergeCommit":{"message":"fix(NA): build external plugins with correct bazel artifacts output mode (#159630)\n\nCloses #159328 ,\r\nhttps://github.com//issues/154325,\r\nhttps://github.com//issues/157440\r\n\r\nThis PR fixes a problem in the plugin helpers tasks used to build\r\nexternal plugins. After changes to transpile packages differently in the\r\npast months a bug was introduced and external plugins were being built\r\nwith the wrong shared ui deps output mode causing development form\r\nimports to be bundled and causing problems at page load time.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"7e067ec47866007051be6afad2a46ab9f8438cb7"}},"sourceBranch":"main","suggestedTargetBranches":["8.7","8.8"],"targetPullRequestStates":[{"branch":"8.7","label":"v8.7.2","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/159630","number":159630,"mergeCommit":{"message":"fix(NA): build external plugins with correct bazel artifacts output mode (#159630)\n\nCloses #159328 ,\r\nhttps://github.com//issues/154325,\r\nhttps://github.com//issues/157440\r\n\r\nThis PR fixes a problem in the plugin helpers tasks used to build\r\nexternal plugins. After changes to transpile packages differently in the\r\npast months a bug was introduced and external plugins were being built\r\nwith the wrong shared ui deps output mode causing development form\r\nimports to be bundled and causing problems at page load time.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"7e067ec47866007051be6afad2a46ab9f8438cb7"}},{"branch":"8.8","label":"v8.8.2","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Tiago Costa <[email protected]>
…tput mode (#159630) (#159761) # Backport This will backport the following commits from `main` to `8.8`: - [fix(NA): build external plugins with correct bazel artifacts output mode (#159630)](#159630) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Tiago Costa","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-06-14T23:43:05Z","message":"fix(NA): build external plugins with correct bazel artifacts output mode (#159630)\n\nCloses #159328 ,\r\nhttps://github.com//issues/154325,\r\nhttps://github.com//issues/157440\r\n\r\nThis PR fixes a problem in the plugin helpers tasks used to build\r\nexternal plugins. After changes to transpile packages differently in the\r\npast months a bug was introduced and external plugins were being built\r\nwith the wrong shared ui deps output mode causing development form\r\nimports to be bundled and causing problems at page load time.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"7e067ec47866007051be6afad2a46ab9f8438cb7","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["chore","Team:Operations","release_note:skip","auto-backport","v8.7.2","v8.9.0","v8.8.2"],"number":159630,"url":"https://github.com/elastic/kibana/pull/159630","mergeCommit":{"message":"fix(NA): build external plugins with correct bazel artifacts output mode (#159630)\n\nCloses #159328 ,\r\nhttps://github.com//issues/154325,\r\nhttps://github.com//issues/157440\r\n\r\nThis PR fixes a problem in the plugin helpers tasks used to build\r\nexternal plugins. After changes to transpile packages differently in the\r\npast months a bug was introduced and external plugins were being built\r\nwith the wrong shared ui deps output mode causing development form\r\nimports to be bundled and causing problems at page load time.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"7e067ec47866007051be6afad2a46ab9f8438cb7"}},"sourceBranch":"main","suggestedTargetBranches":["8.7","8.8"],"targetPullRequestStates":[{"branch":"8.7","label":"v8.7.2","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/159630","number":159630,"mergeCommit":{"message":"fix(NA): build external plugins with correct bazel artifacts output mode (#159630)\n\nCloses #159328 ,\r\nhttps://github.com//issues/154325,\r\nhttps://github.com//issues/157440\r\n\r\nThis PR fixes a problem in the plugin helpers tasks used to build\r\nexternal plugins. After changes to transpile packages differently in the\r\npast months a bug was introduced and external plugins were being built\r\nwith the wrong shared ui deps output mode causing development form\r\nimports to be bundled and causing problems at page load time.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"7e067ec47866007051be6afad2a46ab9f8438cb7"}},{"branch":"8.8","label":"v8.8.2","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Tiago Costa <[email protected]>
Hi!
I have maintain a external plugin.
After upgrading kibana to version
v8.7.0
a plugin after build has incorect path to@kbn/config-schema
.var _kbnConfigSchema = require("../../../packages/kbn-config-schema");
insted of:
var _kbnConfigSchema = require("@kbn/config-schema");
Probably it is regression after: #146212
IMO I have configured everything correctly:
etc.
When I run kibana in dev mode:
yarn start --oss
everything works ok, but problem occurs after plugin installation in desire instance.Logs:
I have also tried copy plugin
preboot_example
fromexamples/
toplugins/
and addpackage.json
:but result is the same.
Here is plugin after build: prebootExample-8.7.0.zip
Best regards,
Mateusz
The text was updated successfully, but these errors were encountered: