Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generating PDF is failing with little clues #54

Closed
fgalan opened this issue Dec 16, 2019 · 3 comments
Closed

generating PDF is failing with little clues #54

fgalan opened this issue Dec 16, 2019 · 3 comments
Labels

Comments

@fgalan
Copy link

fgalan commented Dec 16, 2019

Context:

  • version (md-to-pdf -v): 2.8.2
  • platform (Unix, macOS, Windows): Debian 8.10
  • node version: v8.12.0

Describe the bug:

I'm just doing a basic test. I have installed the package:

npm i -g md-to-pdf

Next, I try to build the PDF for the basic test that comes with the github repository:

git clone https://github.com/simonhaenisch/md-to-pdf
md-to-pdf md-to-pdf/test/basic/test.md 

but I get the following error:

  ✖ generating PDF from md-to-pdf/test/basic/test.md
    → TROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md

However, it's a bit cryptic... I'm not sure which particular error md-to-pdf has found with regards to puppeter or how to debug it. In addition, the cited reference is pretty long, describing diferent kind of problems and not sure which one is the one I could have.

Any help or insight on this would be appreciated. Thanks!

@fgalan fgalan added the bug label Dec 16, 2019
@fgalan
Copy link
Author

fgalan commented Dec 16, 2019

I have solved solved it at the end using installing Chrome (really needed?) and doing:

sudo sysctl -w kernel.unprivileged_userns_clone=1

However, I think documentation in https://github.com/simonhaenisch/md-to-pdf#installation could be improved. If Chrome (or some chrome-related setting) is a requirement, it shoulb be explained in that section.

@simonhaenisch
Copy link
Owner

Hi, there's a --debug flag for the command, which should give you more detailed info.

The reason is probably either that you're missing a dependency or that the sandboxing isn't working for you (in which case you can try disabling it by passing --launch-options="['--no-sandbox', '--disable-setuid-sandbox']").

The reason you're only seeing this line of the error is because Listr only prints the last line, which is often good enough but not in this case. I should probably catch this special error.

@simonhaenisch simonhaenisch changed the title bug: generating PDF is failing with little clues generating PDF is failing with little clues Dec 16, 2019
@fgalan
Copy link
Author

fgalan commented Dec 17, 2019

I should probably catch this special error.

Yes. I think it would be a good idea.

In addition, explaining the requirements regarding Chrome in the installation instructions in the main README.md at https://github.com/simonhaenisch/md-to-pdf#installation should be also very desirable. Thanks!

(Feel free of closing this issue if you think the issue is coverd or leave it opened if if is usefult to you to keep track of the possible task related with it, i.e. capture error, documentation improvement, etc.).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants