Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

phantom stdout: TypeError: undefined is not an object (evaluating 'phantom.args[0]') #42

Closed
matthewmueller opened this issue Oct 10, 2014 · 10 comments

Comments

@matthewmueller
Copy link
Contributor

Running into this when trying to run the examples:

  nightmare queueing action "evaluate" +0ms
  nightmare run +5ms
  nightmare .setup() creating phantom instance on port 12301 +1ms
phantom stdout: TypeError: undefined is not an object (evaluating 'phantom.args[0]')


phantom stdout:   /Users/matt/Playground/node_modules/nightmare/node_modules/phantom/shim.js:5421
  /Users/matt/Playground/node_modules/nightmare/node_modules/phantom/shim.js:5599
  /Users/matt/Playground/node_modules/nightmare/node_modules/phantom/shim.js:159
  /Users/matt/Playground/node_modules/nightmare/node_modules/phantom/shim.js:11 in require

This could definitely be an issue with phantomjs on 10.10, but any ideas?

@matthewmueller
Copy link
Contributor Author

Oh, it could also be because I'm running 2.0.0:

$ phantomjs --version
2.0.0 (development)

@matthewmueller
Copy link
Contributor Author

Yep, that was it. I guess it's a good heads up ;-)

Great project!

@reinpk
Copy link
Contributor

reinpk commented Oct 10, 2014

ah, that is a good heads up, thanks!

@bprodoehl
Copy link

@reinpk What's the outlook on supporting PhantomJS 2.0.0? Do you have any idea how much effort would be involved, and how much the Phantom devs have actually been changing the interfaces? 1.9.7 does a pretty terrible job of rendering interactive D3.js, and my attempts at bridging the gap in my app between what D3 wants and what 1.9.7 supports haven't worked out so far. So far interactive D3.js looks great in PhantomJS 2.0.0.

@bprodoehl
Copy link

Sorry, I see the same error just running phantomjs-node examples, so I don't think this has anything to do with nightmare.

@reinpk
Copy link
Contributor

reinpk commented Oct 15, 2014

ah, bummer, not sure i haven't had a chance to investigate 2.0.0 at all yet

@fernandopasik
Copy link

I'm having the same issue but with phantom 1.9.7, but I'm not running the examples

phantom stdout: TypeError: 'undefined' is not an object (evaluating 'x.options')

@mariodu
Copy link

mariodu commented Oct 20, 2014

My OS is MacOS 10.10,and phantomjs is 2.0.0 (development),has this problem,please fix it

@bprodoehl
Copy link

@mariodu The problem lies in a package that nightmare depends on. I have created a ticket under that project here: https://github.com/sgentle/phantomjs-node/issues/208

@fernandopasik are you sure the problem isn't in your code? I'm not finding "x.options" anywhere in nightmare or phantomjs-node.

@dtothefp
Copy link

I've forked Node PhantomJS and hacked around with it to install the only "stable" version for Mac of Phantom 2.0.0 I could find:

Version I'm using: https://github.com/eugene1g/phantomjs/releases/download/2.0.0-bin/phantomjs-2.0.0-macosx.zip
Fork: https://github.com/dtothefp/phantomjs

So, you could just require the binary path

var phantomPath = require('phantomjs').path
var nightmareOptions = {
  path: phantomPath.substring(0, phantomPath.lastIndexOf('/') + 1),
}

@bprodoehl it looks like you have shimmed the phantomjs-node package and the binary works fine with it. I just tried using the binary with Nightmare and it seems to work fine.

Also, I saw in your PR that the previous phantom.args are defined on system.args. Is this the syntax moving forward with PhantomJS 2.0.0?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

6 participants