simonhaenisch / md-to-pdf

Hackable CLI tool for converting Markdown files to PDF using Node.js and headless Chrome.
https://www.npmjs.com/md-to-pdf
MIT License
1.12k stars 108 forks source link

fix(headless): puppeteer with headless option #298

Closed ehrktia closed 1 month ago

ehrktia commented 1 month ago

puppeteer head less not found error in ubuntu/linux x86_64 GNU/Linux

operating system

Distributor ID: Ubuntu
Description:    Ubuntu 24.04 LTS
Release:        24.04
Codename:       noble

kernel version 6.8.0-35-generic

when trying to convert md to pdf using cli , it gives no headless found error following the suggestion from https://pptr.dev/troubleshooting#setting-up-chrome-linux-sandbox the launch option is updated to use headless explicitly

simonhaenisch commented 1 month ago

Those are not good default options, you can instead configure them specifically for yourself, e.g. via CLI flag:

md-to-pdf --launch-options '{ "args": ["--no-sandbox", "--disable-setuid-sandbox"] }'

Or read about setting up your system properly so you don't have to disable the sandbox feature.

ehrktia commented 1 month ago

thanks was not aware the launch options flag is available in CLI already would have gone with that option