Skip to content
This repository has been archived by the owner on Sep 7, 2022. It is now read-only.

Upgrade to Phantom JS 2.0? #56

Closed
ldeveber opened this issue Feb 2, 2015 · 45 comments
Closed

Upgrade to Phantom JS 2.0? #56

ldeveber opened this issue Feb 2, 2015 · 45 comments
Labels

Comments

@ldeveber
Copy link

ldeveber commented Feb 2, 2015

Phantom JS 2 was released, are there plans to upgrade?

http://phantomjs.org/release-2.0.html

@maku
Copy link

maku commented Feb 3, 2015

Support for PhantomJs 2 would be great.

@shuhei
Copy link

shuhei commented Feb 3, 2015

👍

1 similar comment
@jbuiss0n
Copy link

jbuiss0n commented Feb 4, 2015

👍

@gbrd
Copy link

gbrd commented Feb 4, 2015

👍

1 similar comment
@elexx
Copy link

elexx commented Feb 6, 2015

👍

@carlgieringer
Copy link

karma-phantomjs-launcher depends on the NPM PhantomJS wrapper phantomjs, which might not upgrade to 2.x until 2.1 due to some problems the PhantomJS team is having with creating working binaries for all platforms.

@stramel
Copy link

stramel commented Feb 9, 2015

👍 , looks like they are just waiting for the Linux binaries. ariya/phantomjs#12948. Although, as @carlgieringer stated, it will probably be postponed until 2.1.

@kellyrmilligan
Copy link

does anyone have a good workaround for function.bind not being available in older versions of phantom that will work with karma? the mozilla polyfill won't work with react

@tschaub
Copy link

tschaub commented Mar 24, 2015

@kellyrmilligan I'm using karma-phantomjs-shim with PhantomJS 1.x and React. Let me know if it doesn't work for you (or if the docs aren't clear enough).

@Heshyo
Copy link

Heshyo commented Mar 25, 2015

@kellyrmilligan I've been using the following simple shim (not tested on React). It allows me to use PouchDB.

Function.prototype.bind = Function.prototype.bind || function (thisp) {
    var fn = this;
    return function () {
        return fn.apply(thisp, arguments);
    };
};

@kellyrmilligan
Copy link

@tschaub that is working perfectly, thanks!

@jperry
Copy link

jperry commented Apr 3, 2015

👍

7 similar comments
@pimenovoleg
Copy link

👍

@zeitiger
Copy link

zeitiger commented Apr 9, 2015

👍

@mrzepinski
Copy link

👍

@allenmanning
Copy link

👍

@jasonslyvia
Copy link

👍

@OliverKK
Copy link

👍

@27leaves
Copy link

👍

@dgieselaar
Copy link

Could everyone please stop posting things which add nothing to the discussion? I don't want to open this issue every time I get an email just to see another thumbs up. (Yes I realize this will trigger another notification).

@stramel
Copy link

stramel commented May 14, 2015

👍 @Plestik comment

@just-boris
Copy link

Now I have a success story with new phantomjs. I installed phantom from this ppa and added environment variable PHANTOMJS_BIN=phantomjs to my tests.
Maybe it should get rid of phantomjs as dependency in package.json and release a new version for users which use system phantomjs like me?

@dignifiedquire
Copy link
Member

I totally agree with @just-boris. We should move phantomjs to be a peer dependency at most (as we might need to let people know that the launcher only works with a certain version of phantomjs) but other than that we should leave it up to the user to install the browser and figure out where it is, like we do with the other launchers.

Ref #70

@karma-runner/contributors what you think?

dignifiedquire added a commit that referenced this issue May 29, 2015
@dignifiedquire
Copy link
Member

Moved to peerDeps, you can now install newer phantomjs if you want

@erykpiast
Copy link
Contributor

Hmm, but how? I tried to explicitly depend on phantomjs2 package, but it has different name obviously, so NPM installs version phantomjs@1.9.18 anyway. Is it really the only possible approach, to install PhantomJS in the system and set env?

@dignifiedquire
Copy link
Member

For the time being yes that's the best way to do it. Npm@3 will stop installing peerdependencies so that in turn will remove the overhead of having two installations.

@erykpiast
Copy link
Contributor

Well, ok. Thanks for the answer! I hope PhantomJS@2.1 will be released sooner than NPM@3 ;)

@wethinkagile
Copy link

Interesting, could anybody please be so kind to provide steps how to get the launcher running with PhantomJS2?

@just-boris
Copy link

@nottinhill my success story:

brew install phantomjs
npm install karma-phantomjs-launcher just-boris/phantomjs --save-dev

My magic package forces to use system PhantomJS. So you need install it via brew, if you are using mac, for example

@wethinkagile
Copy link

Thanks m8, testing now.

@wethinkagile
Copy link

Strangely I see now:

INFO [PhantomJS 1.9.8 (Mac OS X 0.0.0)]: Connected on socket 1p0emIMVjTatrVcwE7DV with id 42168014

It is working reproducably well with our blob functionality new Blob([ data ]!

Does this mean Phantom 2 is used but 1.9.8 displayed?

@just-boris
Copy link

@nottinhill nope, that means PhantomJS 1.9.8 is used here.
What do you see on the phantomjs --version output?

@wethinkagile
Copy link

Yes that command is giving back 1.9.8, strangely in my node_modulesdirectory I have 2.0 installed (only), after removing and following your steps. In my package.json I can see: "phantomjs": "git://github.com/just-boris/phantomjs",

@just-boris
Copy link

@nottinhill that guys https://github.com/medium/phantomjs put own phantomjs executable into node_modules/.bin/ folder. You have to clean after that package.
To be sure, that you are doing right, remove whole node_modules and run npm install with new dependencies in package.json again

@wethinkagile
Copy link

Will do! Thanks, great help!

One more thing: PHANTOMJS_BIN=path/to/my/phantomjs2 when using this env var, should I uncomment in my package.json the "phantomjs": "git://github.com/just-boris/phantomjs", ? Sorry a bit confused by this hack.

@just-boris
Copy link

@nottinhill yes, if you have a custom installation provided by PHANTOMJS_BIN var, you don't need to keep my package.
But in this case you will download phantom 1.9.8 on every npm install because https://github.com/medium/phantomjs do it while installing. My package allows to suppress it, an will be ok with custom phantom from PHANTOMJS_BIN

@wethinkagile
Copy link

Great stuff, Boris! I posted a quick step-by-step for Bamboo here: https://github.com/just-boris/phantomjs/issues/1

@wethinkagile
Copy link

@just-boris One more thing I noted, brew install phantomjs pulls in 1.9.8 and not 2.0.0. The formula phantomjs2 is not exitent. Following the build guide on http://phantomjs.org/build.html fails with make[1]: *** [sub-DerivedSources-pri-make_first-ordered] Error 2. On my OSX Yosemite I got it to work with npm install -g phantomjs2 and your guide.

@h20dragon
Copy link

I use a Mac OS X Yosemite with node v0.12.3. I'm also using Karma with PhantomJS, however, I'm not using ./node_modules/**/phantomjs, but remember, that we do need karma-phantomjs-launcher. Here's how I get Karma and PhantomJS working:

  1. Install phamtomjs using homebrew (I'm using version 2.0.0).
  2. Ensure you set your environment variable as follows:

export PHANTOMJS_BIN=[Your full path to phantomjs]

Now, I can run without any issues as discussed by others (e.g. function.bind).

Hope this works for you!

macosx-phantomjs

@gillius
Copy link

gillius commented Jan 20, 2016

I never figured out how to use phantomjs2 with this launcher, so I am using https://github.com/gskachkov/karma-phantomjs2-launcher, which is a fork and worked out of the box.

@gillius
Copy link

gillius commented Jan 21, 2016

Apparently karma-phantomjs2-launcher users a different (older) version of phantomjs that doesn't work on all of the machines (gives openssl errors). So I am back on trying to make this work. I put "karma-phantomjs-launcher": "0.2.3" in my package.json and also "phantomjs2": "2.0.2". I'm using node 5 (npm 3.3.6). So it warns about missing phantomjs peer dependency -- that's great I don't want phantom 1.9.8. But now I get Cannot find plugin "karma-launcher-phantomjs" even if I add it to the karma.conf. It seems like despite the peer dependency being only a warning, the plugin was not totally installed somehow.

@jodytate
Copy link

PhantomJS 2.1 was released yesterday ariya/phantomjs#12970 (might be old news to some of us here)

@dignifiedquire
Copy link
Member

@jodytate thanks, yes we can finally properly upgrade this module :)

@dignifiedquire
Copy link
Member

Fixed in 1.0.0

mpeteuil added a commit to mpeteuil/game-of-life that referenced this issue Apr 14, 2018
mpeteuil added a commit to mpeteuil/game-of-life that referenced this issue Apr 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests