alexscheelmeyer / node-phantom

bridge to PhantomJS from Node.js
317 stars 117 forks source link

Crashes when specifying phantomjs parameters #37

Closed eddiefletchernz closed 11 years ago

eddiefletchernz commented 11 years ago
phantom.create(callback,{parameters:{'ignore-ssl-errors':'yes'}})

This will produce this error:

....\node_modules\node-phantom\node-phantom.js:24
                                args.push('--' + option + '=' + options.parameters[parm]);
                                                 ^
ReferenceError: option is not defined
    at spawnPhantom (....\node_modules\node-phantom\node-phantom.js:24:22)
    at Object.module.exports.create (....\node_modules\node-phantom\node-phantom.js:60:3)

To fix it, replace "option" with "parm" on line 24:

for(var parm in options.parameters) {
                args.push('--' + parm + '=' + options.parameters[parm]);
            }
jsdw commented 11 years ago

I bumped into this same problem. Hopefully it'll be fixed next update :)

CrisFavero commented 11 years ago

I just ran into this problem too... Though looking at the code it was corrected over a month ago , so i will assume that like me you are probably using npm which for whatever reason is installing an older version and this is the real problem, change npm to load the git directly ad it will likely fix your problem too.

Note Dev's should update repo

alexscheelmeyer commented 11 years ago

This is fixed in latest npm version. Sorry for the delay.