html-pdf-chrome icon indicating copy to clipboard operation
html-pdf-chrome copied to clipboard

issue while deployed in pm2 linux

Open adhil-bit opened this issue 1 year ago • 2 comments

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?

adhil-bit avatar Aug 23 '23 13:08 adhil-bit

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

westy92 avatar Oct 01 '23 02:10 westy92

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 to true.

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 your package.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

hydra1983 avatar Oct 31 '23 06:10 hydra1983