Closed nigelzor closed 4 years ago
This could use listen(0)
to let node get a free port and then get the port with server.address().port
. Then if there's any error, it is because it cannot really listen in any port.
Hi, shouldn't this be merged? I think the current retry logic of selectFreePort
is a serious bug: If the first random port ist not available, pdf generation will never be successful without any response because of an endless loop in waitForDebugPort
.
Merged and published
Two fixes:
selectFreePort
was catching errors, but still returning the first port tested (even if it was already taken).renderPdf
wasn't listening for errors when connecting to chrome; I was seeing them show up as unhandled rejections.checkChromeVersion
was doing the right thing, but both are simpler when written usingawait
.