node.jsphantomjsx-ray

X-Ray-Phantom Incompatibile SockJS Error


I am developing Node-Js application using X-Ray library X-Ray-Phantom as a driver and I am getting an error: phantom stdout: Incompatibile SockJS! Main site uses: "0.3.1.7.ga67f.dirty", the iframe: "0.3.4". here is my code:

var phantom = require('x-ray-phantom');
var Xray = require('x-ray');
var x = Xray()
    .driver(phantom());
x('http://google.com', 'title')(function(err, str) {
    assert.equal('Google', str);
    done();
})

Solution

  • I just resolved that with adding this line of code:

    x = Xray().driver(phantom({webSecurity:false}))