Quick fix for “TypeError: undefined is not an object (evaluating ‘phantom.args[0]’)” on Yosemite (Mac OS 10.10)


I jumped back into a project that was lasted worked on before I upgraded to Yosemite. First things first I thought and wanted to run the specs to see if I had a good starting point. When I noticed some feature specs would just seem to hang indefinitely, but beforehand throw me an error on STDOUT

TypeError: undefined is not an object (evaluating ‘phantom.args[0]’)

I researched that error a bit and found out that phantomjs depricated the args attribute in its 2.0.0 release. Since we weren’t depending on any 2.0 features from phantomjs, I gave a quick downgrade a try and turns out, it worked — a quick workaround was found. So to get the downgrade (and I assume you are using homebrew) do the following:

brew install homebrew/versions/phantomjs192
brew unlink phantomjs
brew link —overwrite phantomjs192

Hey if this helped you out in any way, please leave some love and click that heart button for me. Thanks.

Show your support

Clapping shows how much you appreciated Sam Figueroa’s story.