wesleytodd / YeoPress

A Yeoman generator for WordPress
Other
1.08k stars 163 forks source link

Plugin Generator: Object ... has no method 'split' #112

Closed felixarntz closed 9 years ago

felixarntz commented 10 years ago

For some reason, the plugin generator is not working for me. Whenever I run it, I get a message like this:

TypeError: Object wordpress-importer has no method 'split'
    at Object.me.prompt.filter (/usr/local/lib/node_modules/generator-wordpress/plugin/index.js:78:20)
    at Object.utils.runAsync (/usr/local/lib/node_modules/yo/node_modules/yeoman-generator/node_modules/inquirer/lib/utils/utils.js:34:22)
    at Prompt.filter (/usr/local/lib/node_modules/yo/node_modules/yeoman-generator/node_modules/inquirer/lib/prompts/base.js:149:9)
    at Prompt.done (/usr/local/lib/node_modules/yo/node_modules/yeoman-generator/node_modules/inquirer/lib/prompts/base.js:71:10)
    at Prompt.<anonymous> (/usr/local/lib/node_modules/yo/node_modules/yeoman-generator/node_modules/inquirer/lib/prompts/input.js:86:14)
    at Object.utils.runAsync (/usr/local/lib/node_modules/yo/node_modules/yeoman-generator/node_modules/inquirer/lib/utils/utils.js:42:5)
    at Prompt.filter (/usr/local/lib/node_modules/yo/node_modules/yeoman-generator/node_modules/inquirer/lib/prompts/base.js:149:9)
    at Prompt.<anonymous> (/usr/local/lib/node_modules/yo/node_modules/yeoman-generator/node_modules/inquirer/lib/prompts/input.js:76:12)
    at Object.utils.runAsync (/usr/local/lib/node_modules/yo/node_modules/yeoman-generator/node_modules/inquirer/lib/utils/utils.js:42:5)
    at Prompt.validate (/usr/local/lib/node_modules/yo/node_modules/yeoman-generator/node_modules/inquirer/lib/prompts/base.js:137:9)

I simply ran yo wordpress:plugin and entered wordpress-importer for the prompt.

To troubleshoot I went into the plugin/index.js file and inserted the line console.log(input); in the beginning of the filter function. It printed out an array containing the string "wordpress-importer", so it seems that for some reason the input was already turned into an array, therefore not having a method like split.

wesleytodd commented 10 years ago

Interesting. I am not sure that that part of the generator is stable. If you are still having that problem and are interested in figuring out what is wrong I would love to take a PR.

Otherwise I will probably not be able to take a look at it until next weekend. Ether way, update this with anything you find.

felixarntz commented 9 years ago

Unfortunately I have no idea why this might be happening although I looked into it. I've just begun using yo (and also YeoPress) a few weeks ago. But it would be nice if you could look at it some time. I'm still having this same problem. Thank you!

wesleytodd commented 9 years ago

See #115