Skip to content
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

Doesn't throw an error and it just hangs on Ubuntu 16.04 with NodeJS 6.10.3 #37

Open
Defrothew opened this issue May 23, 2017 · 3 comments

Comments

@Defrothew
Copy link

First of all, thanks for this useful package.

I have server on DigitalOcean with this following setup:
Ubuntu 16.04
NodeJS 6.10.3

Used the code below:

var fs = require('fs');
var screenshot = require('electron-screenshot-service');

screenshot({
url : 'http://google.de',
width : 1024,
height : 768
})
.then(function(img){
fs.writeFile('./out.png', img.data, function(err){
screenshot.close();
});
});

Unfortunately, when I run this code, it just hangs and doesn't display any errors in the console nor in the debug file for node.js.

@PlanetIrata
Copy link

Same here with Debian Jessie (v8.8) and Node v8.1.2, the same code that works under Windows 10 / Node v8 hangs under Debian without throwing any error.

Thanks for help

@taboca
Copy link

taboca commented Aug 17, 2017

Same here, just got a new Digital Ocean machine with Ubuntu as pointed above and stalls.

@kribblo
Copy link

kribblo commented Oct 5, 2017

I had this problem trying to run this in a headless container, guess it's the same for you guys; electron needs a DISPLAY to render to, so you need to use something like Xvfb and probably some extra GUI dependencies if it's Ubuntu server edition.

Didn't take the time to figure out exactly what is needed, but in my Dockerfile I have these lines that makes it run for me:

RUN apt-get update && apt-get install -yq xvfb libgtk2.0-0 libgconf2-4 libnss3 libasound2 libxtst6 xvfb gtk2-engines-pixbuf libnotify-dev dbus-x11 libxss1
ENV DISPLAY :99
CMD xvfb-run --server-args='-screen 0 1024x768x24 -ac +extension RANDR' npm start

:99 is default DISPLAY for xvfb-run; there's multiple other ways to run this, and you may not use Docker at all, but in short:

  • install those dependecies
  • export DISPLAY as environment variable
  • start the app using Xvfb

Hope that helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants