# Error when rendering visualization plugin

**URL:** <https://discuss.elastic.co/t/error-when-rendering-visualization-plugin/245322>\
**Category:** Kibana\
**Created:** [August 17, 2020, 11:27pm UTC](https://discuss.elastic.co/t/error-when-rendering-visualization-plugin/245322 "2020-08-17T23:27:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ylasri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ylasri/32/86120_2.png) [@ylasri](https://discuss.elastic.co/u/ylasri)\
**Post date:** [August 17, 2020, 11:27pm UTC](https://discuss.elastic.co/t/error-when-rendering-visualization-plugin/245322/1 "2020-08-17T23:27:33Z")

</div>

I am using Kibana master branch to develop a new visualization  
I am using Base Visualization Type like  
`visualizations.createBaseVisualization(getExampleVisDefinition());`

I am getting this error when trying to render my visulization  
Can someone tel what is the issue exactly ?

` Uncaught TypeError: this.visualization.render is not a function`

This is the sample i use for my controller

```
import { VisParams, ExprVis } from '../../../../src/plugins/visualizations/public';
export function ExampleVisualizationProvider() {

  return class ExampleBaseVisualization {

    vis: ExprVis | undefined = undefined;
    el: HTMLElement | undefined = undefined;

    constructor(el: HTMLElement, vis: ExprVis) {
      this.el = el;
      this.vis = vis;
    }

    async render(visData: any, visParams: VisParams) {
      return 'done rendering';
    }

    destroy() {
      // eslint-disable-next-line no-console
      console.log('destroying');
      if (this.el !== undefined) {
        this.el.innerHTML = '';
      }
    }
  };
}
```

---

<div class="post-metadata">

**Author:** ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)\
**Post date:** [August 18, 2020, 9:24am UTC](https://discuss.elastic.co/t/error-when-rendering-visualization-plugin/245322/2 "2020-08-18T09:24:40Z")

</div>

There is not enough information to tell for sure, can you share your complete plugin, e.g. on Github?

Tagcloud is a good example for this kind of a visualization till then: [https://github.com/elastic/kibana/tree/master/src/plugins/vis\_type\_tagcloud/public](https://github.com/elastic/kibana/tree/master/src/plugins/vis_type_tagcloud/public)

---

<div class="post-metadata">

**Author:** ![ylasri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ylasri/32/86120_2.png) [@ylasri](https://discuss.elastic.co/u/ylasri)\
**Post date:** [August 18, 2020, 2:09pm UTC](https://discuss.elastic.co/t/error-when-rendering-visualization-plugin/245322/3 "2020-08-18T14:09:43Z")

</div>

Thanks @flash1293 for your feedback  
Exactly i was inspired by the example you provided me  
I was able to use ReactVisualization without issue, but got issue with BaseViz  
Could you please check the example in [github](https://github.com/synapticielfactory/kibana_cohort_np_plugin)

---

<div class="post-metadata">

**Author:** ![ylasri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ylasri/32/86120_2.png) [@ylasri](https://discuss.elastic.co/u/ylasri)\
**Post date:** [August 18, 2020, 3:49pm UTC](https://discuss.elastic.co/t/error-when-rendering-visualization-plugin/245322/4 "2020-08-18T15:49:30Z")

</div>

Thanks @flash1293 for your quick help  
I was able to fixe the issue  
I forgot to call my controller as a function in the visualization Type

---

<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:** [September 15, 2020, 3:49pm UTC](https://discuss.elastic.co/t/error-when-rendering-visualization-plugin/245322/5 "2020-09-15T15:49:45Z")

</div>

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