marp-team / marp-cli

A CLI interface for Marp and Marpit based converters
MIT License
1.85k stars 105 forks source link

The latest Docker image fails PDF rendering (`Protocol error (Page.printToPDF): printing failed`) #538

Closed yhatt closed 1 year ago

yhatt commented 1 year ago

This is a blocker to release the minor version of Marp CLI (v3.2.0).

$ docker run --rm --init --entrypoint="" -it marpteam/marp-cli /bin/sh
/home/marp/app # echo 'Test' > test.md
/home/marp/app # marp-cli.js test.md --pdf
[  INFO ] Converting 1 markdown...
[ ERROR ] Failed converting Markdown. (Protocol error (Page.printToPDF): Printing failed)

537 has been updated Puppeteer to v21, that is comatible version with Chromium installed in the image, but it still has no luck.

/home/marp/app # chromium-browser --version
Chromium 115.0.5790.170 Alpine Linux

Debug log

DEBUG="*" marp-cli.js test.md --pdf

...
puppeteer:protocol:SEND ► [
puppeteer:protocol:SEND ►   '{"method":"Page.printToPDF","params":{"transferMode":"ReturnAsStream","landscape":false,"displayHeaderFooter":false,"headerTemplate":"","footerTemplate":"","printBackground":true,"scale":1,"paperWidth":8.5,"paperHeight":11,"marginTop":0,"marginBottom":0,"marginLeft":0,"marginRight":0,"pageRanges":"","preferCSSPageSize":true},"id":15,"sessionId":"27ED98338D873A50586E69A7B9048D15"}'
puppeteer:protocol:SEND ► ] +0ms
puppeteer:protocol:RECV ◀ [
puppeteer:protocol:RECV ◀   '{"id":15,"error":{"code":-32000,"message":"Printing failed"},"sessionId":"27ED98338D873A50586E69A7B9048D15"}'
puppeteer:protocol:RECV ◀ ] +0ms
...