# Plugin porting doesn't work - 6.4.4 =\> 7.0.0

**URL:** <https://discuss.elastic.co/t/plugin-porting-doesnt-work-6-4-4-7-0-0/182182>\
**Category:** Kibana\
**Created:** [May 22, 2019, 9:02am UTC](https://discuss.elastic.co/t/plugin-porting-doesnt-work-6-4-4-7-0-0/182182 "2019-05-22T09:02:59Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lino\_Capalbo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lino_capalbo/32/42420_2.png) [@Lino\_Capalbo](https://discuss.elastic.co/u/Lino_Capalbo)\
**Post date:** [May 22, 2019, 9:02am UTC](https://discuss.elastic.co/t/plugin-porting-doesnt-work-6-4-4-7-0-0/182182/1 "2019-05-22T09:02:59Z")

</div>

Hi everyone,  
I’m getting a strange issue porting an AngularJS plugin from kibana 6.4.4 (it works fine with this release) to kibana 7.0.0; when I try to instantiate my plugin on a Visualize I get immediately the error shown in the picture below (“Error in visualization – column is undefined”). Kibana doesn’t log anything.

![Kibana_error](https://us1.discourse-cdn.com/elastic/original/3X/b/d/bd6c074f3536391a7f7c80e9cc5b82fea5df615e.jpeg)

> <https://gist.github.com/pasqualecapalbo/eb991bf6b78e3a3fb152c41d5398db27>

Environment: ELK 7.0.0 runs on a VM Ubuntu 18.04.2 LTS 64bit.

Any help will be appriciated.

Thanks.

---

<div class="post-metadata">

**Author:** ![lukas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas/32/6812_2.png) [@lukas](https://discuss.elastic.co/u/lukas)\
**Post date:** [May 22, 2019, 4:08pm UTC](https://discuss.elastic.co/t/plugin-porting-doesnt-work-6-4-4-7-0-0/182182/2 "2019-05-22T16:08:57Z")

</div>

Hmm, not exactly sure what's happening here but could you try changing your `require` statement to an `import`?

---

<div class="post-metadata">

**Author:** ![Lino\_Capalbo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lino_capalbo/32/42420_2.png) [@Lino\_Capalbo](https://discuss.elastic.co/u/Lino_Capalbo)\
**Post date:** [May 24, 2019, 11:03am UTC](https://discuss.elastic.co/t/plugin-porting-doesnt-work-6-4-4-7-0-0/182182/3 "2019-05-24T11:03:03Z")

</div>

Thanks for your reply, Lukas!

I made some correction in sm\_status\_light\_vis.js and now, strangely, the error turned in "Error: Cannot read property 'aggConfig' of undefined" (showed once the first time after selecting an index, two time if I press the Refresh button):

![image](https://us1.discourse-cdn.com/elastic/original/3X/8/6/86dc2efa832131625408e45cdf948d80227bcf27.png)

---

<div class="post-metadata">

**Author:** ![Lino\_Capalbo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lino_capalbo/32/42420_2.png) [@Lino\_Capalbo](https://discuss.elastic.co/u/Lino_Capalbo)\
**Post date:** [May 24, 2019, 12:17pm UTC](https://discuss.elastic.co/t/plugin-porting-doesnt-work-6-4-4-7-0-0/182182/4 "2019-05-24T12:17:55Z")

</div>

I solved the error just putting

defaults: [  
{ type: 'count', schema: 'metric' }

in group: 'metrics'  
...but..  
I'don't see any drawing on Visual canvas, obviously after populating all necessary field as I did in 6.4.4 environment.

I put some console.log statements in sm\_status\_light\_controller.js (updated on gist) but nothing is displayed in terminal where I've started kibana (yarn start from kibana dir): is it normal ?

---

<div class="post-metadata">

**Author:** ![Lino\_Capalbo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lino_capalbo/32/42420_2.png) [@Lino\_Capalbo](https://discuss.elastic.co/u/Lino_Capalbo)\
**Post date:** [May 27, 2019, 9:16am UTC](https://discuss.elastic.co/t/plugin-porting-doesnt-work-6-4-4-7-0-0/182182/5 "2019-05-27T09:16:29Z")

</div>

Hi,  
finally I've understand how to debug with DevTools...  
I found the error :

"angular.js:14800 TypeError: Cannot read property '0' of undefined"

on this line:

```
    // Retrieve the id of the configured tags aggregation
    var statusAggId = $scope.vis.aggs.bySchemaName['status'][0].id;

```

Is it possible to know how to fix it ?

Thanks.

---

<div class="post-metadata">

**Author:** ![Lino\_Capalbo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lino_capalbo/32/42420_2.png) [@Lino\_Capalbo](https://discuss.elastic.co/u/Lino_Capalbo)\
**Post date:** [May 29, 2019, 7:31am UTC](https://discuss.elastic.co/t/plugin-porting-doesnt-work-6-4-4-7-0-0/182182/6 "2019-05-29T07:31:06Z")

</div>

Hi All,  
the error shown above occur only the first time, when metric is properly configured but no bucket is define and I think it's quiet normal...

If i configure a single bucket, debugging the source code i found that the following line:

var buckets = resp.aggregations[statusAggId].buckets;

shows that no key called aggregations is defined for resp object:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/d/5/d594b2c0f70c5b9fa15804a4c7b83da38be69998.png)

maybe something is changed passing from 6.4.4 to 7.0.0... but I can't figure out where the buckets object is now located under resp object.

Please, any help will be appriciated.

Thanks.

---

<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:** [June 26, 2019, 7:31am UTC](https://discuss.elastic.co/t/plugin-porting-doesnt-work-6-4-4-7-0-0/182182/7 "2019-06-26T07:31:09Z")

</div>

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