wesleytodd / YeoPress

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

Generator throws type errors #76

Closed swashcap closed 10 years ago

swashcap commented 10 years ago

After selecting “Run the Wordpress generator” from Yeoman, I get the following:

/usr/local/lib/node_modules/generator-wordpress/app/index.js:53
  this.logger.verbose('\nOptions: ' + JSON.stringify(this.options, null, '  '))
                                           ^
TypeError: Converting circular structure to JSON
    at Object.stringify (native)
    at new Generator (/usr/local/lib/node_modules/generator-wordpress/app/index.js:53:43)
    at Environment.create (/usr/local/lib/node_modules/yo/node_modules/yeoman-generator/lib/env/index.js:325:10)
    at Environment.run (/usr/local/lib/node_modules/yo/node_modules/yeoman-generator/lib/env/index.js:361:24)
    at yoyo._initGenerator (/usr/local/lib/node_modules/yo/yoyo.js:62:12)
    at yoyo.<anonymous> (/usr/local/lib/node_modules/yo/yoyo.js:366:33)
    at Object.<anonymous> (/usr/local/lib/node_modules/yo/node_modules/yeoman-generator/node_modules/inquirer/lib/inquirer.js:81:7)
    at /usr/local/lib/node_modules/yo/node_modules/async/lib/async.js:229:13
    at /usr/local/lib/node_modules/yo/node_modules/async/lib/async.js:139:25
    at /usr/local/lib/node_modules/yo/node_modules/async/lib/async.js:226:17

Yikes! I’m running the latest and greatest:

wesleytodd commented 10 years ago

I was unable to reproduce this. I am also on node 0.10.24, yeopress 1.3.2 and yeoman 1.0.6 on OSx. Are you on windows? What settings did you use? Any more information you can provide would be helpful.

swashcap commented 10 years ago

@wesleytodd Thanks for getting back!

This was on the work machine, which is running OSX 10.9.1. I just updated my laptop and I’m getting the same errors.

wesleytodd commented 10 years ago

Could you add a console.log(this.options) there right before the line the error happened on and paste the output in here? I am just not sure what would cause a circular json structure. I can remove the log I guess, but I am not sure what is causing it.

swashcap commented 10 years ago

So interesting. When I run yo wordpress it works. However, when I run yo and select “Run the Wordpress generator (1.3.2)” it throws the error without logging the options.

I’m fairly new to Node, so I’m not sure if this is a Yeoman thing. Other generators (Angular and WebApp) seem to work fine.

wesleytodd commented 10 years ago

Probably a yeoman/yeopress thing. I have actually never run the generator in that way. So I guess it add's some different options when run in that way. I will leave this ticket open until I can find the time to fix it or submit a bug report to yeoman.

Thanks for the good report and following up!

wesleytodd commented 10 years ago

Got this fixed up. Apparently there is an issue when running the generator in this way. The options object is different thatn when running the generator the normal way. I am going to see if there are any other issues I can solve today then release this with v1.3.4.