# TypeError: Cannot read property 'error' of undefined while creating Kibana Plugin

**URL:** https://discuss.elastic.co/t/typeerror-cannot-read-property-error-of-undefined-while-creating-kibana-plugin/41554
**Category:** Kibana
**Created:** [February 11, 2016, 9:05pm UTC](https://discuss.elastic.co/t/typeerror-cannot-read-property-error-of-undefined-while-creating-kibana-plugin/41554 "2016-02-11T21:05:40Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![PhaedrusTheGreek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/phaedrusthegreek/32/4884_2.png) [@PhaedrusTheGreek](https://discuss.elastic.co/u/PhaedrusTheGreek)
#### Post date: [February 11, 2016, 9:05pm UTC](https://discuss.elastic.co/t/typeerror-cannot-read-property-error-of-undefined-while-creating-kibana-plugin/41554/1 "2016-02-11T21:05:41Z")

</div>

Following advice from here:

here: [https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md)

and here: [https://www.npmjs.com/package/generator-kibana-plugin](https://www.npmjs.com/package/generator-kibana-plugin)

Generated base plugin from the base yeoman, and can't start Kibana without getting this error, when my plugin is in place:

```auto
FATAL [TypeError: Cannot read property 'error' of undefined]
server log [13:37:57.478] [fatal] TypeError: Cannot read property 'error' of undefined
    at OptionManager.mergeOptions (/Users/jay/Workspace/kibana/node_modules/babel-core/lib/transformation/file/options/option-manager.js:126:28)
    at OptionManager.addConfig (/Users/jay/Workspace/kibana/node_modules/babel-core/lib/transformation/file/options/option-manager.js:107:10)
    at OptionManager.findConfigs (/Users/jay/Workspace/kibana/node_modules/babel-core/lib/transformation/file/options/option-manager.js:168:35)
    at OptionManager.init (/Users/jay/Workspace/kibana/node_modules/babel-core/lib/transformation/file/options/option-manager.js:229:12)
    at compile (/Users/jay/Workspace/kibana/node_modules/babel-core/lib/api/register/node.js:117:22)
    at normalLoader (/Users/jay/Workspace/kibana/node_modules/babel-core/lib/api/register/node.js:199:14)
    at Object.require.extensions.(anonymous function) [as .js] (/Users/jay/Workspace/kibana/node_modules/babel-core/lib/api/register/node.js:216:7)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at Plugins._new$ (/Users/jay/Workspace/kibana/src/server/plugins/PluginCollection.js:22:28)
    at tryCatch (/Users/jay/Workspace/kibana/node_modules/babel-runtime/regenerator/runtime.js:67:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (/Users/jay/Workspace/kibana/node_modules/babel-runtime/regenerator/runtime.js:315:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/Users/jay/Workspace/kibana/node_modules/babel-runtime/regenerator/runtime.js:100:21)
    at invoke (/Users/jay/Workspace/kibana/node_modules/babel-runtime/regenerator/runtime.js:136:37)
FATAL [TypeError: Cannot read property 'error' of undefined]
 optimizer crashed with status code 1

```

---

<div class="post-metadata">

### Author: ![Joe\_Fleming](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joe_fleming/32/3561_2.png) [@Joe\_Fleming](https://discuss.elastic.co/u/Joe_Fleming)
#### Post date: [February 11, 2016, 9:52pm UTC](https://discuss.elastic.co/t/typeerror-cannot-read-property-error-of-undefined-while-creating-kibana-plugin/41554/2 "2016-02-11T21:52:34Z")

</div>

Can you check what version of the generator you're using? I pushed 0.2.1 because 0.2.0 broke stuff, and I recall seeing just that error. I suspect an upgrade to the generator would fix this.

EDIT: I'm assuming you're starting from the generator. If not, you can at least see what differences exist between your plugin and the generator, primarily in the main index.js file. Also, if you'd like faster feedback for help with this, feel free to join us on IRC in #kibana on [chat.freenode.net](http://chat.freenode.net)

---

<div class="post-metadata">

### Author: ![PhaedrusTheGreek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/phaedrusthegreek/32/4884_2.png) [@PhaedrusTheGreek](https://discuss.elastic.co/u/PhaedrusTheGreek)
#### Post date: [February 12, 2016, 1:53pm UTC](https://discuss.elastic.co/t/typeerror-cannot-read-property-error-of-undefined-while-creating-kibana-plugin/41554/3 "2016-02-12T13:53:34Z")

</div>

@Joe_Fleming

```auto
  "version": "0.2.1"

```

---

<div class="post-metadata">

### Author: ![timroes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timroes/32/19712_2.png) [@timroes](https://discuss.elastic.co/u/timroes)
#### Post date: [February 18, 2016, 11:44pm UTC](https://discuss.elastic.co/t/typeerror-cannot-read-property-error-of-undefined-while-creating-kibana-plugin/41554/4 "2016-02-18T23:44:15Z")

</div>

@PhaedrusTheGreek The current version of the generator is broken (due to the usage of Babel 6, whereas Kibana still use Babel 5). You have to wait for the next release of the generator.

---

<div class="post-metadata">

### Author: ![Joe\_Fleming](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joe_fleming/32/3561_2.png) [@Joe\_Fleming](https://discuss.elastic.co/u/Joe_Fleming)
#### Post date: [February 25, 2016, 9:01pm UTC](https://discuss.elastic.co/t/typeerror-cannot-read-property-error-of-undefined-while-creating-kibana-plugin/41554/5 "2016-02-25T21:01:56Z")

</div>

It looks like Spencer pushed some changes. @PhaedrusTheGreek can you grab the latest version of the generator (1.0.1) and see if you're still having issues with it? And if so, would you mind opening an issue at [on the generator repo](https://github.com/elastic/generator-kibana-plugin)?

---

<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: [July 6, 2017, 2:01pm UTC](https://discuss.elastic.co/t/typeerror-cannot-read-property-error-of-undefined-while-creating-kibana-plugin/41554/6 "2017-07-06T14:01:07Z")

</div>


