Closed Haerezis closed 6 years ago
I have this problem, too. now are you Solve the problem
这个问题 已经解决了 你可以使用下面的命令:
npm install ws@3.3.2 --save-dev --save-exact
@Haerezis
Thanks. After digging, it seems like there were already a issue for this problem : https://github.com/alvarcarto/url-to-pdf-api/issues/57.
The problem seems related to ws and puppeteer.
So I'm closing this issue.
Hi,
I get this error randomly when I try to generate a pdf from my local url-to-pdf.
What I get
The server crash with the following error :
Error: read ECONNRESET at exports._errnoException (util.js:1018:11) at TCP.onread (net.js:568:26)
. curl printcurl: (52) Empty reply from server
What I do
curl -o test_.pdf -XPOST -d@test-subject.html -H"content-type: text/html" http://localhost:9000/api/render\?emulateScreenMedia=false\&goto.waitUntil\=load
Solution?
This bug only happens AFTER the pdf generation, when
browser.close()
is called, but I don't know if this is caused by puppeteer closing its connexion to chrome, or the connexion to one of the assets of the page. Because this error happens after the pdf generation, I'm inclined to ignore it, and it can be done by adding a callback onprocess.on('uncaughtException', (error) => {})
, but I'm not sure that's the correct thing to do, but for now it's the only solution I can provide.The html file I use