Custom plugin error

I'm a beginner programmer and I don't quite understand whyb I'm getting a certain error. I wanted to be able to input html/javascript on my dashboard for a custom application and so the easiest way I found was by following these instructions and editing the markdown widget source code:

Everything works fine except sometimes when I try and add the markdown widget to a dashboard I get this error:

Error: Uncaught TypeError: Cannot read property 'col' of undefined (http://XXXXX:5601/app/kibana#/dashboard?_g=(refreshInterval:('$$hashKey':'object:312',display:'10%20seconds',pause:!f,section:1,value:10000),time:(from:now-7d,mode:quick,to:now))&_a=(filters:!(),options:(darkTheme:!f),panels:!(),query:(query_string:(query:'*')),title:'New%20Dashboard',uiState:()):1301)

at window.onerror (http://XXXXX:5601/bundles/commons.bundle.js?v=14588:69:13503)

Can anyone point me on why I'm getting this error? Why is my 'col' undefined? I really need to use custom JS/HTML for my dash so I hope someone can help me out with this!

Is editing the source code in my kibana a no no? hehe :sweat_smile:

After some more time, I'm finding that just changing that tiny bit of code is making the whole functionality of Kibana mess up. Even when making a dashbaord with visuals that have nothing to do with the plugin I created, I get the same error. Specifically when I press add and select a visualization to put onto the dashboard. Or when I create a dashboard and recently had created a visualization (again, one that has nothing to do with the plugin) and try to change anything about the dashboard (add or save the dashbaord) I get this error.

My version of Kibana is 5.1.2. Can someone help me understand?

Instead of modifying the markdown visualization, I would recommend building an actual plugin that defines a new visualization type. You can read up on some information about building plugins here

Yeah, I'm trying to work my way up to that, but because of a time constraint I need a quicker fix. Although the prospect of writing my own plugins excites me!!

Do you have any idea what this undefined "col" that the error is referring to?

Sorry, I'm not sure. I'd suggest grabbing the source from, try making your edits in the source, and then run Kibana in dev mode with npm start. You'll get source maps that will make debugging the issue easier using your browser's dev tools.

Great, thanks for the response :slight_smile:

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