html-pdf-chrome
html-pdf-chrome copied to clipboard
issue while deployed in pm2 linux
General Error: Error: connect ECONNREFUSED 127.0.0.1:34733 0|admin | at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1495:16) { 0|admin | errno: -111, 0|admin | code: 'ECONNREFUSED', 0|admin | syscall: 'connect', 0|admin | address: '127.0.0.1', 0|admin | port: 34733 0|admin | } got an error like this any solution?
Is this still an issue? If so, could you please share:
- html-pdf-chrome version
- Linux distro and version
- pm2 version
- Node.js version
- Chrome version
I have set a specific IP address for the host
, but it defaults to 127.0.0.1
To resolve this issue:
- Set the
useHostName
totrue
.
After upgrading Chrome to version 114
, I encountered an error: Using unsafe HTTP verb GET to invoke /json/new. This action supports only the PUT verb.
. To rectify this:
- Use
chrome-remote-interface@^0.32.0
- Ensure the
resolutions
are properly configured in yourpackage.json
.
const options: CreateOptions & {
useHostName: boolean
} = {
host,
port,
printOptions: {
...request,
},
useHostName: true
};
console.log(
`Generate pdf through html-pdf-chrome with options ${JSON.stringify(
options,
null,
2
)}`
);
const pdf = await htmlPdf.create(html, options);
return pdf.toBuffer();
"resolutions": {
"chrome-remote-interface": "^0.32.0"
},
Fixing Chrome DevTools warning "Using unsafe HTTP verb" and Export of Jaspersoft Graphical Reports fails post upgrade of Google Chrome
hope this can help you
- Node: v16.19.1
- html-pdf-chrome: ^0.8.4
- chrome-headless: 114.0.5735.106