donpark/html2jade — Issue #28: Errors on startup (apparently during argument logging)
Author: aadamowski
Created: 2011-12-06 21:59:23+00:00
State: open

Standard html2jade 0.1.0 either npm install, or from github src :

$ html2jade http://www.mcli.dist.maricopa.edu/tut/tut1.html

node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
^
TypeError: Converting circular structure to JSON
at Object.stringify (native)
at Command. (/home/nodejs/.node_libraries/.npm/html2jade/0.1.2/package/bin/html2jade:54:51)
at Command. (/home/nodejs/.node_libraries/.npm/commander/0.5.0/package/lib/commander.js:232:8)
at Command.emit (events.js:64:17)
at Command.parseArgs (/home/nodejs/.node_libraries/.npm/commander/0.5.0/package/lib/commander.js:401:12)
at Command.parse (/home/nodejs/.node_libraries/.npm/commander/0.5.0/package/lib/commander.js:349:15)
at Object. (/home/nodejs/.node_libraries/.npm/html2jade/0.1.2/package/bin/html2jade:95:9)
at Module._compile (module.js:402:26)
at Object..js (module.js:408:10)
at Module.load (module.js:334:31)

Seems that the cause is this line:

console.log("default action invoked: " + JSON.stringify(arguments));

Since it's just a debug message, we can try to comment it out.

Then it goes further, but still fails at line 70:

$ ./bin/html2jade http://www.mcli.dist.maricopa.edu/tut/tut1.html
options: {"scalate":false}

node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
^
TypeError: Object # has no method 'match'
at Object.urlParse [as parse] (url.js:112:42)
at Command. (/home/nodejs/src/html2jade/bin/html2jade:70:15)
at Command. (/home/nodejs/.node_libraries/.npm/commander/0.5.0/package/lib/commander.js:232:8)
at Command.emit (events.js:64:17)
at Command.parseArgs (/home/nodejs/.node_libraries/.npm/commander/0.5.0/package/lib/commander.js:401:12)
at Command.parse (/home/nodejs/.node_libraries/.npm/commander/0.5.0/package/lib/commander.js:349:15)
at Object. (/home/nodejs/src/html2jade/bin/html2jade:95:9)
at Module._compile (module.js:402:26)
at Object..js (module.js:408:10)
at Module.load (module.js:334:31)

Possibly an incompatibility with the latest commander version?