Phantomjs: Reference Error: Can't find variable: Set

Created on 22 May 2017  路  3Comments  路  Source: ariya/phantomjs

  1. Which version of PhantomJS are you using? Tip: run phantomjs --version.

    • 2.1.1

  2. What steps will reproduce the problem?

    • Used the github.js sample code from the main site

Example:

var page = require("webpage").create();
page.open("https://developers.arcgis.com/javascript/latest/sample-code/widgets-print/live/index.html", function(status) {
    if(status == "success"){
        page.render("web.png");
    } else {
        console.log("cant load page");
    }

    phantom.exit();

});
  1. Which operating system are you using?
  2. Windows 10
  3. Did you use binary PhantomJS or did you compile it from source?
  4. Binary PhantomJS
  5. Please provide any additional information below.
    It returns: ReferenceError: Can't find variable: Set. The above sample is not my web page, but it is using a Javascript API provided by ESRI, which my web page is also using. So, it is throwing the same error.

Most helpful comment

@mdominado actually does anyone know the state of things for PhantomJS? After maintainer Vitaly's announcement in April that he is stepping down. And Chrome headless is coming, Firefox headless is coming.

I really hope and still believe someone or organization would step up to take on the baton. After all, so much vested interests have been made in the PhantomJS ecosystem. Or at least some form of mitigation steps to ease any transition.

All 3 comments

@mdominado I'm a CasperJS user for couple of years, now browsing through open issues on CasperJS/PhantomJS. The JS looks minified to try to decode, looks like issue happens elsewhere so wanted to link this - https://github.com/giakki/uncss/issues/304

Sounds like PhantomJS version not supporting Set? - https://stackoverflow.com/questions/38051320/unable-to-find-element-using-selenium-and-phantomjs

@kensoh

Yeah the code is definitely minified, so all I can tell is that it wants to use a Set to do something. In any case, I agree with you on the Set not being supported by PhantomJS, that was one of my guesses, but I hoped that wasn't going to be the case.

I assume there is no way around it at this point then. Until PhantomJS supports the newer EMCAScript standards, there is not really much I can do. Especially, considering that there might be more functionalities from the newer ES6 standard that the API I'm using has implemented.

@mdominado actually does anyone know the state of things for PhantomJS? After maintainer Vitaly's announcement in April that he is stepping down. And Chrome headless is coming, Firefox headless is coming.

I really hope and still believe someone or organization would step up to take on the baton. After all, so much vested interests have been made in the PhantomJS ecosystem. Or at least some form of mitigation steps to ease any transition.

Was this page helpful?
0 / 5 - 0 ratings