Giter Club home page Giter Club logo

Comments (14)

pofider avatar pofider commented on July 20, 2024 2

@0x62 Do you have macOS Sierra?

The default phantomjs doesn't work there and you need to use phantomjs2
https://github.com/pofider/phantom-html-to-pdf#phantomjs2

from phantom-html-to-pdf.

mcrowder65 avatar mcrowder65 commented on July 20, 2024 2

I am on macOS Sierra and I get this error occasionally, and I am also using phantomjs2.

from phantom-html-to-pdf.

pofider avatar pofider commented on July 20, 2024 1

@chevin99 I've updated readme to mentioned this. Don't hesitate to send PR next time :)

from phantom-html-to-pdf.

juergengunz avatar juergengunz commented on July 20, 2024 1

@mcrowder65 same for me, did you end up fixing that?

from phantom-html-to-pdf.

pofider avatar pofider commented on July 20, 2024

Hi, just tried your piece of code with express and works for me on windows and ubuntu as well.

  • Aren't you working on some kind of a shared hosting environment?
  • does ../temp exist?

from phantom-html-to-pdf.

jmcollin78 avatar jmcollin78 commented on July 20, 2024

Hi,
I'm working on a local Windows PC,
../temp exists. If I remove it, I've got another error.

Is there something to run before launching tests ? A phantomJS server or something like that ?

JM.

from phantom-html-to-pdf.

jmcollin78 avatar jmcollin78 commented on July 20, 2024

Hum I notice that this error appears only on the first call. Subsequent call are OK. Maybe it is due to start time or start time synchro (my PC is relatively slow).

JM.

from phantom-html-to-pdf.

pofider avatar pofider commented on July 20, 2024

Oh, that is the problem probably. It is waiting just 500ms for phantomjs.exe to start what could be not enough for slower computer.

I will think about smarter implementation here.

from phantom-html-to-pdf.

jmcollin78 avatar jmcollin78 commented on July 20, 2024

OK. Maybe you van tell me where is this timeout set. I will change
manually waiting for your smarter implémentation.
Le 31 mars 2015 20:23, "Jan Blaha" [email protected] a écrit :

Oh, that is the problem probably. It is waiting just 500ms for
phantomjs.exe to start what could be not enough for slower computer.

I will think about smarter implementation here.


Reply to this email directly or view it on GitHub
#1 (comment)
.

from phantom-html-to-pdf.

pofider avatar pofider commented on July 20, 2024

I think it should be here
https://github.com/pofider/phantom-workers/blob/master/lib/phantomWorker.js#L42

from phantom-html-to-pdf.

pofider avatar pofider commented on July 20, 2024

Now it is fixed in the dependent package.
https://github.com/pofider/phantom-workers/releases/tag/0.1.2

from phantom-html-to-pdf.

0x62 avatar 0x62 commented on July 20, 2024

I'm having exactly this error at the moment, running on a 2015 Macbook Pro.

{ Error: connect ECONNREFUSED 127.0.0.1:54363
    at Object.exports._errnoException (util.js:1026:11)
    at exports._exceptionWithHostPort (util.js:1049:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1085:14)
  code: 'ECONNREFUSED',
  errno: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 54363 }

Code:

const phantomExport = require('phantom-html-to-pdf')();

phantomExport({ html: "<h3>Hello world</h3>" }, (err, pdf) => {
  console.log(err);
})
$ node -v
v6.9.0

from phantom-html-to-pdf.

0x62 avatar 0x62 commented on July 20, 2024

I am on Sierra. Thank's for the heads up.

from phantom-html-to-pdf.

chevin99 avatar chevin99 commented on July 20, 2024

@pofider it would be helpful to mention in the readme/docs that phantomjs2 is required on macOS Sierra. Thankfully searching around and finding this issue helped me figure that out, but I imagine others may be having the same problem when trying to run the 'hello world' example. Thanks for your work on this 😄.

from phantom-html-to-pdf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.