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

Node 8 Alpine Phantom #702

Closed
talyuk opened this issue Oct 19, 2017 · 3 comments

Comments

@talyuk
Copy link

@talyuk talyuk commented Oct 19, 2017

I have Node 8 Alpine image at Docker, I installed Alpine specific package (from this issue), but when I tried to run simple.js from examples, createPage() didn't work. Phantom instance was created, but then creating page didn't anything. No exception, no executing. What can be wrong?

I added comments to simple.js:

phantom
  .create()
  .then(ph => {
    console.log('PHANTOM');
    _ph = ph;
    return _ph.createPage();
  })
  .then(page => {
    console.log('PAGE');
    _page = page;
    return _page.open('https://stackoverflow.com/');
  })
  .then(status => {
    console.log(status);
    return _page.property('content');
  })
  .then(content => {
    console.log(content);
    _page.close();
    _ph.exit();
  })
  .catch(e => console.log(e));

And I see only 'PHANTOM'.

  • OS: Alpine Node 8
  • Node version (node -v): 8.6.0
  • package version: 4.0.5
@amir20

This comment has been minimized.

Copy link
Owner

@amir20 amir20 commented Oct 19, 2017

It sounds like you don't have phantomjs installed correctly. What does your dockerfile look like? I have a dockerfile in the example folder that doesn't use alpine. So you have to make sure you install

  libsqlite3-dev libfontconfig1-dev libicu-dev libfreetype6 libssl-dev \
  libpng-dev libjpeg-dev python libx11-dev libxext-dev
@amir20

This comment has been minimized.

Copy link
Owner

@amir20 amir20 commented Oct 19, 2017

Also try running docker run -it <image> sh and then run phantomjs. If that fails then you should fix it first.

@talyuk

This comment has been minimized.

Copy link
Author

@talyuk talyuk commented Oct 19, 2017

I had node:alpine image, but I didn't have enough time to resolve this issue, so I installed node:8 image without Alpine specific phantomjs package, and got working phantom

@talyuk talyuk closed this Oct 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.