DEV Community

Discussion on: node-html-to-image v1.2 is out 🎉

Collapse
 
emersongarrido profile image
Emerson Garrido

Every time I go to upload the application in production on the linux server ubuntu I have to set the args configuration: ["--no-sandbox"] in puppeter, would I be able to fix this in your lib?

I believe that several people are going through the same problem.

Collapse
 
ivan_feofilaktov_23de8dd3 profile image
Ivan Feofilaktov • Edited

Use config like mine one:

nodeHtmlToImage({
output: "test.png",
html: "<html><body>Hello world!</body></html>",
puppeteerArgs: {
headless: true,
executablePath: '/usr/bin/google-chrome-stable',
ignoreDefaultArgs: ['--disable-extensions'],
args: [ '--no-sandbox', '--disable-setuid-sandbox', '--disable-dev-shm-usage', '--disable-accelerated-2d-canvas', '--no-first-run', '--no-zygote', ],
ignoreCache: true
}
})
.then(() => console.log('The image was created successfully!'))