# Fatal Error after Creating Kibana Plugin

**URL:** <https://discuss.elastic.co/t/fatal-error-after-creating-kibana-plugin/97434>\
**Category:** Kibana\
**Created:** [August 17, 2017, 2:11pm UTC](https://discuss.elastic.co/t/fatal-error-after-creating-kibana-plugin/97434 "2017-08-17T14:11:01Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![FareehaNaaz](https://avatars.discourse-cdn.com/v4/letter/f/7ba0ec/32.png) [@FareehaNaaz](https://discuss.elastic.co/u/FareehaNaaz)\
**Post date:** [August 17, 2017, 2:11pm UTC](https://discuss.elastic.co/t/fatal-error-after-creating-kibana-plugin/97434/1 "2017-08-17T14:11:01Z")

</div>

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.

> <https://github.com/angular/angular.js/issues/15786>

  

> <https://github.com/angular/material/issues/10505>

  

> <https://stackoverflow.com/questions/44150674/angular-cookies-error>

Can anybody Guide me on this?

 ![Untitled](https://us1.discourse-cdn.com/elastic/original/3X/9/4/949d34cc0d7233dcd9e888cdd7018c5041ff1428.png) ![js(1)](https://us1.discourse-cdn.com/elastic/original/3X/c/8/c863e8949f13189eab296b7d3b3077a0131ee6be.png) ![js(2)](https://us1.discourse-cdn.com/elastic/original/3X/4/6/46ea516e686294a96303bfbecab4b87c194c3099.png)

---

<div class="post-metadata">

**Author:** ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)\
**Post date:** [August 18, 2017, 11:57pm UTC](https://discuss.elastic.co/t/fatal-error-after-creating-kibana-plugin/97434/2 "2017-08-18T23:57:47Z")

</div>

> [@FareehaNaaz](#):
>
> i am trying to redirect from index.html to new2.html, the following attachment is my app.js file:

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

> [@FareehaNaaz](#):
>
> my issue here is i end getting a fatal error which says “angular.module” function isnt a valid function

Have you tried following Tim Roes' excellent [guide on building a plugin](https://www.timroes.de/2016/02/21/writing-kibana-plugins-custom-applications/)? 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.

---

<div class="post-metadata">

**Author:** ![FareehaNaaz](https://avatars.discourse-cdn.com/v4/letter/f/7ba0ec/32.png) [@FareehaNaaz](https://discuss.elastic.co/u/FareehaNaaz)\
**Post date:** [August 21, 2017, 9:44am UTC](https://discuss.elastic.co/t/fatal-error-after-creating-kibana-plugin/97434/3 "2017-08-21T09:44:19Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)\
**Post date:** [August 21, 2017, 5:08pm UTC](https://discuss.elastic.co/t/fatal-error-after-creating-kibana-plugin/97434/4 "2017-08-21T17:08:40Z")

</div>

> [@FareehaNaaz](#):
>
> Hi, i did look into that, but still i cant redirect to pages

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

> [@FareehaNaaz](#):
>
> i have noticed after going into the plugin in UI when i click again the Plugin in sidebar, i get blank page.

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](https://github.com/elastic/kibana/pull/13044)

---

<div class="post-metadata">

**Author:** ![FareehaNaaz](https://avatars.discourse-cdn.com/v4/letter/f/7ba0ec/32.png) [@FareehaNaaz](https://discuss.elastic.co/u/FareehaNaaz)\
**Post date:** [August 23, 2017, 10:59am UTC](https://discuss.elastic.co/t/fatal-error-after-creating-kibana-plugin/97434/5 "2017-08-23T10:59:08Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![FareehaNaaz](https://avatars.discourse-cdn.com/v4/letter/f/7ba0ec/32.png) [@FareehaNaaz](https://discuss.elastic.co/u/FareehaNaaz)\
**Post date:** [August 29, 2017, 8:47am UTC](https://discuss.elastic.co/t/fatal-error-after-creating-kibana-plugin/97434/6 "2017-08-29T08:47:56Z")

</div>

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](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](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](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

---

<div class="post-metadata">

**Author:** ![FareehaNaaz](https://avatars.discourse-cdn.com/v4/letter/f/7ba0ec/32.png) [@FareehaNaaz](https://discuss.elastic.co/u/FareehaNaaz)\
**Post date:** [September 4, 2017, 10:10am UTC](https://discuss.elastic.co/t/fatal-error-after-creating-kibana-plugin/97434/7 "2017-09-04T10:10:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![softec17](https://avatars.discourse-cdn.com/v4/letter/s/4af34b/32.png) [@softec17](https://discuss.elastic.co/u/softec17)\
**Post date:** [September 6, 2017, 11:33am UTC](https://discuss.elastic.co/t/fatal-error-after-creating-kibana-plugin/97434/8 "2017-09-06T11:33:50Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![FareehaNaaz](https://avatars.discourse-cdn.com/v4/letter/f/7ba0ec/32.png) [@FareehaNaaz](https://discuss.elastic.co/u/FareehaNaaz)\
**Post date:** [September 11, 2017, 12:48pm UTC](https://discuss.elastic.co/t/fatal-error-after-creating-kibana-plugin/97434/9 "2017-09-11T12:48:56Z")

</div>

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

 ![Capture](https://us1.discourse-cdn.com/elastic/original/3X/0/a/0a7d72cbb77402e8b9972b1a554ea1818ef79ea3.PNG)

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

---

<div class="post-metadata">

**Author:** ![softec17](https://avatars.discourse-cdn.com/v4/letter/s/4af34b/32.png) [@softec17](https://discuss.elastic.co/u/softec17)\
**Post date:** [September 13, 2017, 8:38am UTC](https://discuss.elastic.co/t/fatal-error-after-creating-kibana-plugin/97434/10 "2017-09-13T08:38:15Z")

</div>

it would be Great if someone guides on this.

---

<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:** [October 11, 2017, 8:38am UTC](https://discuss.elastic.co/t/fatal-error-after-creating-kibana-plugin/97434/11 "2017-10-11T08:38:19Z")

</div>

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