kernoeb/docker-docsify-pdf

await puppeteer.launch freezes

Closed this issue · 3 comments

I was not able to generate a PDF.

After some debug, I found out that puppeteer.launch was freezing (src/render.js).

The work around is to add args: ['--single-process'] to the options (as pointed out in puppeteer/puppeteer#1409 (comment)).

  const browser = await puppeteer.launch({
    args: ['--single-process'],
    defaultViewport: {
      width: 1200,
      height: 1000,
    }

Should this be added to the troubleshooting section?

Fell free to close the issue. Maybe it is just my setup. But it will be here if others have the same problem.

Hello, interesting 🤔
I use docker-docsify-pdf multiple times a day since months and never got this issue

Feel free to add your example in the README (maybe a better way is to add a PUPPETEER_OPTIONS in the environment variables, so everyone can configure it without need to build a new image)

Thanks for the feedback @kernoeb
I was not aware of PUPPETEER_OPTIONS. That's a better option.

Well, it doesn't exist atm but it would be really easy to add a process.env.PUPPETEER_OPTIONS here https://github.com/kernoeb/docker-docsify-pdf/blob/main/src/render.js#L11