-
-
Notifications
You must be signed in to change notification settings - Fork 742
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Webpage is showing "Can't find variable: Promise" waring on pageres 4.5.0 and phantomjs 2.1.1 #304
Comments
You could just specify a path to the file containing your polyfill. E.g (assuming you're using the CLI):
|
Ok, I'm using this approach, and still the same error. The script is in the same directory. any other ideas? function getImage(call) {
const pageres = new Pageres({
delay: 15,
filename: fileName,
script: 'promise.min.js'
})
.src(url, ['1366x768'])
.dest(__dirname)
.on('warning', function(err) {
console.log('Warning: ' + err);
})
.run()
.then(function() {
console.log('End');
call();
}) Thanks for your help! |
Try using |
Thanks again for your help. After testing different scenarios, and your suggestions, the problem seems to be how phantomjs renders the website. |
We will be supporting headless Chromium in the future. See kevva/screenshot-stream#40. For now, no. |
Hi,
I'm trying to get a snapshot of a webpage that contains an embedded Power BI report. The snapshot is not showing some components of the page that are shown in other browsers. After checking the warnings, I got some js errors that are not shown in Chrome, the waring are like this:
Warning: ReferenceError: Can't find variable: Promise → http://[...]/powerbi.js on line 5277
It seems to be an issue with phantomjs and ES6 (which I'm not sure if it still present in recent versions of phantomjs). I also read that can it be fixed including some libraries in the code, for example promise-polyfill, but I’m not sure if that will help nor how to include that code in the 'script:' option.
I’m using Nodejs v 6.10.3, phantomjs v 2.1.1 and pageres 4.5.0
Can anybody help me to fix this issue? Thanks in advance!
The text was updated successfully, but these errors were encountered: