# Plugin doesn't work after Kibana update

**URL:** <https://discuss.elastic.co/t/plugin-doesnt-work-after-kibana-update/134749>\
**Category:** Kibana\
**Created:** [June 6, 2018, 7:28am UTC](https://discuss.elastic.co/t/plugin-doesnt-work-after-kibana-update/134749 "2018-06-06T07:28:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kvin](https://avatars.discourse-cdn.com/v4/letter/k/e99b99/32.png) [@Kvin](https://discuss.elastic.co/u/Kvin)\
**Post date:** [June 6, 2018, 7:28am UTC](https://discuss.elastic.co/t/plugin-doesnt-work-after-kibana-update/134749/1 "2018-06-06T07:28:53Z")

</div>

Hi,

We want to upgrade our stack from 5.2 to 6.2.4. As suggested in the documentation, first I'm trying to upgrade the stack to 5.6.9 so I'll be able to do a rolling update to 6.2.4 from that.

However we have a custom made Kibana plugin, and it doesn't seem to work in 5.6.9. When I want to start it, I get the following error:

> Fatal Error  
> Uncaught TypeError: Cannot read property 'get' of undefined ([https://kibana-host/bundles/custom\_plugin.bundle.js?v=15629:2](https://kibana-host/bundles/custom_plugin.bundle.js?v=15629:2))  
> Version: 5.6.9  
> Build: 15629  
> Error: Uncaught TypeError: Cannot read property 'get' of undefined ([https://kibana-host/bundles/custom\_plugin.bundle.js?v=15629:2](https://kibana-host/bundles/custom_plugin.bundle.js?v=15629:2))  
> at window.onerror ([https://kibana-host/bundles/custom\_plugin.bundle.js?v=15629:90:23848](https://kibana-host/bundles/custom_plugin.bundle.js?v=15629:90:23848))

The console says:

> Error: Uncaught TypeError: Cannot read property 'get' of undefined ([https://kibana-host/bundles/custom\_plugin.bundle.js?v=15629:2](https://kibana-host/bundles/custom_plugin.bundle.js?v=15629:2))  
> at window.onerror (commons.bundle.js?v=15629:90)  
> Notifier.\_showFatal @ commons.bundle.js?v=15629:89  
> Notifier.fatal @ commons.bundle.js?v=15629:89  
> wrapper @ commons.bundle.js?v=15629:1  
> window.onerror @ commons.bundle.js?v=15629:90  
> error (async)  
> 2510 @ commons.bundle.js?v=15629:90  
> **webpack\_require** @ commons.bundle.js?v=15629:1  
> 2446 @ commons.bundle.js?v=15629:87  
> **webpack\_require** @ commons.bundle.js?v=15629:1  
> 0 @ custom\_plugin.bundle.js?v=15629:1  
> **webpack\_require** @ commons.bundle.js?v=15629:1  
> window.webpackJsonp @ commons.bundle.js?v=15629:1  
> (anonymous) @ custom\_plugin.bundle.js?v=15629:1  
> Uncaught TypeError: Cannot read property 'get' of undefined  
> at new DirectiveManager (custom\_plugin.bundle.js?v=15629:2)  
> at Object.4569 (custom\_plugin.bundle.js?v=15629:2)  
> at **webpack\_require** (commons.bundle.js?v=15629:1)  
> at Object.4567 (custom\_plugin.bundle.js?v=15629:2)  
> at **webpack\_require** (commons.bundle.js?v=15629:1)  
> at Object.4561 (custom\_plugin.bundle.js?v=15629:1)  
> at **webpack\_require** (commons.bundle.js?v=15629:1)  
> at Object.0 (custom\_plugin.bundle.js?v=15629:1)  
> at **webpack\_require** (commons.bundle.js?v=15629:1)  
> at window.webpackJsonp (commons.bundle.js?v=15629:1)  
> DirectiveManager @ custom\_plugin.bundle.js?v=15629:2  
> 4569 @ custom\_plugin.bundle.js?v=15629:2  
> **webpack\_require** @ commons.bundle.js?v=15629:1  
> 4567 @ custom\_plugin.bundle.js?v=15629:2  
> **webpack\_require** @ commons.bundle.js?v=15629:1  
> 4561 @ custom\_plugin.bundle.js?v=15629:1  
> **webpack\_require** @ commons.bundle.js?v=15629:1  
> 0 @ custom\_plugin.bundle.js?v=15629:1  
> **webpack\_require** @ commons.bundle.js?v=15629:1  
> window.webpackJsonp @ commons.bundle.js?v=15629:1  
> (anonymous) @ custom\_plugin.bundle.js?v=15629:1  
> Uncaught Error: Uncaught TypeError: Cannot read property 'get' of undefined ([https://kibana-host/bundles/custom\_plugin.bundle.js?v=15629:2](https://kibana-host/bundles/custom_plugin.bundle.js?v=15629:2))  
> at window.onerror (commons.bundle.js?v=15629:90)

Was there a change in Angular or Node JS I'm not aware of which makes the code not compatible with the newer version of Kibana?

---

<div class="post-metadata">

**Author:** ![Kvin](https://avatars.discourse-cdn.com/v4/letter/k/e99b99/32.png) [@Kvin](https://discuss.elastic.co/u/Kvin)\
**Post date:** [June 6, 2018, 11:11am UTC](https://discuss.elastic.co/t/plugin-doesnt-work-after-kibana-update/134749/2 "2018-06-06T11:11:10Z")

</div>

I think I managed to find the problem.

At one point in the plugin's code there's this line:

`import * as uiModules from 'ui/modules';`

However it becomes undefined. As I understand, this is a directory which should be available to any plugin which invokes it: [https://www.elastic.co/guide/en/kibana/current/development-dependencies.html](https://www.elastic.co/guide/en/kibana/current/development-dependencies.html)

What could be the cause of this? The exact same code runs without any issue in 5.2.0.

---

<div class="post-metadata">

**Author:** ![Kvin](https://avatars.discourse-cdn.com/v4/letter/k/e99b99/32.png) [@Kvin](https://discuss.elastic.co/u/Kvin)\
**Post date:** [June 7, 2018, 10:29am UTC](https://discuss.elastic.co/t/plugin-doesnt-work-after-kibana-update/134749/3 "2018-06-07T10:29:44Z")

</div>

In the end this thread helped me to solve my problem:

> <https://github.com/elastic/generator-kibana-plugin/issues/57>
>
> I tried following the instructions but when I run Kibana and click on the plugin… I get the following message: (Note: my plugins name is Lane Search)
> 
> Error: Uncaught TypeError: Cannot read property 'get' of undefined (http://localhost:5601/bundles/Lane\_Search.bundle.js?v=15117:1)
> at window.onerror (http://localhost:5601/bundles/commons.bundle.js?v=15117:77:8927)
> 
> I know this is probably my fault and not the actual code, but I'd like to get some feedback

I had to replace

> import \* as uiModules from 'ui/modules';  
> …  
> this.module = uiModules.default.get('app/custom\_plugin', );

with this

> import { uiModules } from 'ui/modules';  
> …  
> this.module = uiModules.get('app/custom\_plugin', );

I had to realize that importing "ui/routes" has also changed.

From this

> import \* as uiRoutes from 'ui/routes';  
> …  
> this.route = uiRoutes.default;

to this

> import uiRoutes from 'ui/routes';  
> …  
> this.route = uiRoutes;

---

<div class="post-metadata">

**Author:** ![cjcenizal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cjcenizal/32/11216_2.png) [@cjcenizal](https://discuss.elastic.co/u/cjcenizal)\
**Post date:** [June 7, 2018, 11:34pm UTC](https://discuss.elastic.co/t/plugin-doesnt-work-after-kibana-update/134749/4 "2018-06-07T23:34:44Z")

</div>

Hi there, thanks for posting your solution. Nice work figuring it out!

Best,  
CJ

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2018, 11:34pm UTC](https://discuss.elastic.co/t/plugin-doesnt-work-after-kibana-update/134749/5 "2018-07-05T23:34:46Z")

</div>

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