Skip to content
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

Kibana Plugins Cause Fatal Error #12707

Closed
seoa opened this issue Jul 7, 2017 · 7 comments
Closed

Kibana Plugins Cause Fatal Error #12707

seoa opened this issue Jul 7, 2017 · 7 comments

Comments

@seoa
Copy link

seoa commented Jul 7, 2017

Kibana version: 5.5.0

Elasticsearch version: 5.5.0

Server OS version: macOS Sierra 10.12.5

Browser version: Safari 10.1.1

Browser OS version: macOS Sierra 10.12.5

Original install method (e.g. download page, yum, from source, etc.): homebrew

Description of the problem including expected versus actual behavior: I had plugins that were working fine in 5.4.x that now throw a fatal error in the updated 5.5.0 version of kibana/elasticsearch. I have tried installing various plugins and they all throw the same error. Changing the version element to "5.5.0" in package.json inside the plugins did not help.

Steps to reproduce:

  1. install plugin
  2. load kibana

Errors in browser console (if relevant):
screen shot 2017-07-07 at 11 06 43 am

Error: TypeError: undefined is not an object (evaluating '_modules2["default"].get') (http://localhost:5601/bundles/kibana.bundle.js?v=1:282)
onerror@http://localhost:5601/bundles/commons.bundle.js?v=1:90:20889

Provide logs and/or server output (if relevant):

@epixa
Copy link
Contributor

epixa commented Jul 7, 2017

Those plugins need to be updated to work with 5.5.0. It's not simply a version bump (though they'll need that as well), as they are trying to import functions from within Kibana that are no longer exposed in the same way.

That plugins can break in this way is exactly why we say that plugins must specify an exact version of Kibana that they have been tested to be compatible with.

I recommend reaching out to the plugin authors directly and seeing if/when they'll be able to update their plugin to be compatible with 5.5.

@epixa epixa closed this as completed Jul 7, 2017
@fbaligand
Copy link
Contributor

@epixa
As this breaking change is impacting all community plugins (I personally reproduce the same error to all my plugins), could you provide some guidelines to make migration ?
At least, which kibana JS service has changed ? I mean specifically for this error.
And ideally, what is the new recommended way to do the same ?

@epixa
Copy link
Contributor

epixa commented Jul 10, 2017

@fbaligand Unfortunately we don't know exactly what change is causing this issue, so I can't provide exact guidelines. Based on the error message, I believe the issue might have something to do with the relatively recent change (an effort that started in 5.4.0 and continued into 5.5.0) in Kibana to move from default exports to named exports.

e.g.

export default function myFunction() {}
import myFunction from './mymodule';

// becomes:

export function myFunction() {}
import { myFunction } from './mymodule';

This was spread across a ton of pull requests, but here's one of them for a concrete example: #11165

This happened for all of the ui/registry imports as well, so if you're importing any code from Kibana core (including a ui/registry), then you'll need to update your import reference accordingly.

@RMKD
Copy link

RMKD commented Jul 10, 2017

is this the syntax you mean? so the solution is to update import statements in the root public/foo_vis.js with {} style imports? (seems like this issue should remain open until there is better migration documentation and/or error checking)

git diff 5.4..5.5
diff --git a/src/ui/public/vislib_vis_type/vislib_vis_type.js b/src/ui/public/vislib_vis_type/vislib_vis_type.js
index b042b2981..81813b028 100644
--- a/src/ui/public/vislib_vis_type/vislib_vis_type.js
+++ b/src/ui/public/vislib_vis_type/vislib_vis_type.js
@@ -5,51 +5,64 @@ import 'plugins/kbn_vislib_vis_types/controls/point_series_options';
 import 'plugins/kbn_vislib_vis_types/controls/line_interpolation_option';
 import 'plugins/kbn_vislib_vis_types/controls/heatmap_options';
 import 'plugins/kbn_vislib_vis_types/controls/point_series';
-import VisVisTypeProvider from 'ui/vis/vis_type';
-import AggResponsePointSeriesPointSeriesProvider from 'ui/agg_response/point_series/point_series';
+import 'plugins/kbn_vislib_vis_types/controls/gauge_options';
+import { VisVisTypeProvider } from 'ui/vis/vis_type';
+import { AggResponsePointSeriesProvider } from 'ui/agg_response/point_series/point_series';
 import VislibVisTypeVislibRenderbotProvider from 'ui/vislib_vis_type/vislib_renderbot';
-export default function VislibVisTypeFactory(Private) {
+
+export function VislibVisTypeVislibVisTypeProvider(Private) {
   const VisType = Private(VisVisTypeProvider);
-  const pointSeries = Private(AggResponsePointSeriesPointSeriesProvider);
+  const pointSeries = Private(AggResponsePointSeriesProvider);
   const VislibRenderbot = Private(VislibVisTypeVislibRenderbotProvider);
 

@fbaligand
Copy link
Contributor

Thanks @epixa for your answer.

@fbaligand
Copy link
Contributor

@seoa @RMKD
For information, these are the updates I've done on "transform_vis" plugin to migrate it (successfully) to Kibana 5.5.0 :
https://github.com/PhaedrusTheGreek/transform_vis/pull/7/files

@snuids
Copy link

snuids commented Sep 3, 2017

@fbaligand Thanks. I migrated my code accordingly and I have now a working traffic light visualizer for Kibana 5.5. https://github.com/snuids/TrafficLightVisKibana5.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants