Fatal Error after Creating Kibana Plugin

Hi,
i was Creating my own plugin using "yo kibana-plugin", after ruuning this command i get app.js in "plugin/public/app.js" location and index.html in "plugin/public/templates/index.html"

here i did replace my index.html with my html code, and also placed another html in the same location, now by writing my angular code in app.js i am trying to redirect from index.html to new2.html, the following attachment is my app.js file:

Just in case you are wondering i did install Angular.js, Angular-route.js and Angular-resource.js in the given location by "npm install angular@1.6.5" and so for the other two, all of them are latest versions.

my issue here is i end getting a fatal error which says "angular.module" function isnt a valid function, i did end up finding the solution in the following links, but none of them help me out, i dont get the fatal erro anymore, but i dont even see my html file contents.



Can anybody Guide me on this?

1 Like

Instead of attaching the files using screenshots of your editor, how about make a repo posted to Github?

Have you tried following Tim Roes' excellent guide on building a plugin? He talks about using the ui/modules module from Kibana instead of working with angular.module directly.

The article also talks about "Creating routing options," which is where you'll learn how to "redirect" to your "new2.html" template.

I would recommend reading the whole article and follow step by step to get the basics.

Hi, i did look into that, but still i cant redirect to pages, also i have noticed after going into the plugin in UI when i click again the Plugin in sidebar, i get blank page.

You have to look at the tutorial in more depth to understand how to set up Angular routing for your plugin.

By default, Kibana loads the last page it loaded for a plugin when you re-navigate back to it. You can disable that by setting linkToLastSubUrl: false in your uiExports.app config. See Allow plugins to turn off the “link to last URL” navigation helper by tsullivan · Pull Request #13044 · elastic/kibana · GitHub

i dont find any such path in my kibana work directory , neither in my plugin dir. other than that i tried to search for files having "linkToLastSubUrl" as true and change it to false, but the files i found contains linkToLastSubUrl as false.
apart from that i searched for file "ui_app.js" i found one in kibana dir but that dosent has "linkToLastSubUrl" option.

i still face the same issue, and this what my kibana log file shows:

$ tail -f npm-debug.log.1141371993
9 error argv "/home/farya/.nvm/versions/node/v6.10.2/bin/node" "/home/farya/.nvm/versions/node/v6.10.2/bin/npm" "list"
10 error node v6.10.2
11 error npm v3.10.10
12 error code EPIPE
13 error errno EPIPE
14 error syscall write
15 error write EPIPE
16 error If you need help, you may report this error at:
16 error https://github.com/npm/npm/issues
17 verbose exit [ 1, true ]

and my plugin log file shows:

$ tail -f npm-debug.log
23 error If you do, this is most likely a problem with the plugin_sraha package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error plugin-helpers start "--elasticsearch.url" "http://...:9200"
23 error You can get information on how to open an issue for this project with:
23 error npm bugs plugin_sraha
23 error Or if that isn't available, you can get their info via:
23 error npm owner ls plugin_sraha
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]

^C
[farya@kibanasgpl plugin_sraha]$ npm bugs plugin_sraha
npm ERR! Linux 3.10.0-327.el7.x86_64
npm ERR! argv "/home/farya/.nvm/versions/node/v6.10.2/bin/node" "/home/farya/.nvm/versions/node/v6.10.2/bin/npm" "bugs" "plugin_sraha"
npm ERR! node v6.10.2
npm ERR! npm v3.10.10
npm ERR! code E404

npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/plugin_sraha
npm ERR! 404
npm ERR! 404 'plugin_sraha' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! Please include the following file with any support request:
npm ERR! /home/farya/plugin_sraha/npm-debug.log

[farya@kibanasgpl plugin_sraha]$ npm owner ls plugin_sraha
npm ERR! owner ls Couldn't get owner data plugin_sraha
npm ERR! Linux 3.10.0-327.el7.x86_64
npm ERR! argv "/home/farya/.nvm/versions/node/v6.10.2/bin/node" "/home/farya/.nvm/versions/node/v6.10.2/bin/npm" "owner" "ls" "plugin_sraha"
npm ERR! node v6.10.2
npm ERR! npm v3.10.10
npm ERR! code E404

npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/plugin_sraha
npm ERR! 404
npm ERR! 404 'plugin_sraha' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! Please include the following file with any support request:
npm ERR! /home/farya/plugin_sraha/npm-debug.log

Can someone Guide me on this? i still face the same issue.

hi! i face similar kind of issue, can we get some help here?

1 Like

hi earlier i use to see only this certificate issue in my console, but now i see this, i ddi try to find this file but there is no such file in my work dir

and when i click the ip and host which i did hide, i get the following code:

it would be Great if someone guides on this.

1 Like

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