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

(Jay Greenberg) #1

Following advice from here:

here: https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md

and here: 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:

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

(Joe Fleming) #2

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

(Jay Greenberg) #3


  "version": "0.2.1"

(Tim Roes) #4

@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.

(Joe Fleming) #5

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?

(system) #6