Below is a small puppeteer program, it worked fine when headless: false. But it started failing when i changed headless: 'new'
Below is the error message
Been trying to resolve this for nearly two days, looking into all the Github issues and stackoverlow. Man! resolving one error kept on leading to another error.
Finally, went and asked Bard, couple of questions on this and it suggested to use xvfb.
It gave a below simple program
Above code, first creates an Xvfb instance. Xvfb is a virtual X server that can be used to run headless browsers.
Once the Xvfb instance is started, Puppeteer can be launched with the xvfb: true option. This tells Puppeteer to use the Xvfb instance for rendering.