alexscheelmeyer / node-phantom

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

createPage callback not fired in node v0.10 #58

Closed cedmax closed 11 years ago

cedmax commented 11 years ago

I've noticed that using node 0.10 this code doesn't work

(function(){
    var phantom = require('node-phantom');

    phantom.create(function(e, ph){
        ph.createPage(function() {
            console.log("in");
        });
    });
})();

not sure what the issue is, but it works just fine with node 0.11 and <0.10

skotchio commented 11 years ago

I have the same one!

accerqueira commented 11 years ago

I had the same problem with node v0.10.8, upgraded to v0.10.12 and the problem is gone!

skotchio commented 11 years ago

Yes in a new nodejs version all works fine!

alexscheelmeyer commented 11 years ago

Weird. I am currently on 0.10.7 and does not see issues. Probably just a temporary fluke in node.

jokeyrhyme commented 10 years ago

I'm currently experiencing this with Node.JS v0.10.26 on OS X 10.9.3 (dev seed).

According to my console.log output, the callback for phantom.create is being called, with no error, but the callback for ph.createPage is not being called at all. I'm even really sure where to start diagnosing this.

jokeyrhyme commented 10 years ago

By the way, that's with the phantomjs@1.9.7-4 and node-phantom@0.2.5 packages.

Could this be related to #97 ?

electerious commented 10 years ago

Same problem when using node v0.10.28, phantomjs@1.9.7 and node-phantom@0.2.5 on OS X 10.9.


console.log 0

phantom.create (err, ph) ->

    console.log 1
    console.log err
    console.log ph

    ph.createPage (err, page) ->

        console.log 2

The output:

0
1
null
{ createPage: [Function],
  injectJs: [Function], …

The callback of ph.createPage never fires. No error…

electerious commented 10 years ago

102 is responsible for this issue.

zhouseahe commented 10 years ago

@alexscheelmeyer , It seems several people confused by the version of socket.io . So , ah, I think you can test again . If Socket.io >=1.0.0 have no much promote for node-phantom , Set version to 0.9.17 should be considered . what if it's a bug of Socket.io . thanks for your work . thanks you can read my lines

Ryan-YJL commented 10 years ago

The latest version of node and socket.io are causing problems hanging with no response or an "Enoent" error. I'm using node locally for parsing/scraping data from the web so I can set the version as required.

Using the info the commenters, I downgraded to node 0.10.7 and set node_modules/node-phantom/package.json to use

"dependencies": {
    "socket.io": "0.9.17"
  },

npm install and got it working again.