Skip to content

Marp-core PDF generation breaks with Chrome 130 #617

@synacktiv-antoineg

Description

@synacktiv-antoineg

Version of Marp Tool

marp-cli v4.0.2 (with marp-core v4.0.0)

Operating System

Linux

Environment

$ tree
.
├── Containerfile
├── Containerfile.healthy
├── slides.md
└── startup.sh

1 directory, 4 files
$ cat Containerfile
FROM docker.io/alpine:3.20.3

RUN apk update && \
    apk add --no-cache wget curl jq patch libc6-compat gcompat libgc++ libgcc chromium npm font-dejavu font-liberation font-noto-emoji

ENV npm_config_loglevel silent

RUN npm i --global @marp-team/marp-cli

RUN mkdir -p /work/slides

ADD slides.md /work/slides/slides.md
ADD startup.sh /work/startup.sh

RUN chmod +x /work/startup.sh

ENV MARP_USER marp:marp
WORKDIR /work/
ENTRYPOINT ["/work/startup.sh"]

Note that the only difference between Containerfile and Containerfile.healthy is the alpine version (and thus the chromium version)

$ cat Containerfile.healthy 
FROM docker.io/alpine:3.19

RUN apk update && \
    apk add --no-cache wget curl jq patch libc6-compat gcompat libgc++ libgcc chromium npm font-dejavu font-liberation font-noto-emoji

ENV npm_config_loglevel silent

RUN npm i --global @marp-team/marp-cli

RUN mkdir -p /work/slides

ADD slides.md /work/slides/slides.md
ADD startup.sh /work/startup.sh

RUN chmod +x /work/startup.sh

ENV MARP_USER marp:marp
WORKDIR /work/
ENTRYPOINT ["/work/startup.sh"]
$ cat slides.md 
----

# Exemple
Text
Other

DD/MM/2024

----

<!-- _class: end -->
<!-- _paginate: false -->

| Icon                                      | Link                                       |
| :---------------------------------------- | :----------------------------------------- |
| ![height:50px](/assets/images/linkedin.png) | https://www.example.com/ |
| ![height:50px](/assets/images/twitter.png)  | https://twitter.com/exawmple              |
| ![height:50px](/assets/images/website.png)  | https://example.com                      |
$ cat startup.sh 
#!/bin/sh

echo "========= VERSIONS ========="

chromium --version
npm -v
npm list -g
marp --version

echo "========= OUTPUTS ========="

#!/bin/bash
for i in `seq 1 50`
do
  time marp --pdf /work/slides/slides.md
done

How to reproduce

$ podman build -t bug -f Containerfile .
$ podman build -t healthy -f Containerfile.healthy .

$ podman run -it --rm bug
<here you can see the PDF conversion failing and timing out>
<feel free to hit CTRL+C when you feel you've waited enough>

$ podman run -it --rm healthy
<here you can see the PDF conversion happening over and over again with no issue whatsoever>
<feel free to hit CTRL+C when you feel you've seen enough>

Example run:

$ podman run -it --rm bug
========= VERSIONS =========
Chromium 130.0.6723.91 Alpine Linux
10.8.0
/usr/local/lib
`-- @marp-team/[email protected]

@marp-team/marp-cli v4.0.2 (w/ @marp-team/marp-core v4.0.0)
========= OUTPUTS =========
[  INFO ] Converting 1 markdown...
/usr/local/lib/node_modules/@marp-team/marp-cli/node_modules/puppeteer-core/lib/cjs/puppeteer/common/CallbackRegistry.js:94
    #error = new Errors_js_1.ProtocolError();
             ^

ProtocolError: Network.enable timed out. Increase the 'protocolTimeout' setting in launch/connect calls for a higher timeout if needed.
    at <instance_members_initializer> (/usr/local/lib/node_modules/@marp-team/marp-cli/node_modules/puppeteer-core/lib/cjs/puppeteer/common/CallbackRegistry.js:94:14)
    at new Callback (/usr/local/lib/node_modules/@marp-team/marp-cli/node_modules/puppeteer-core/lib/cjs/puppeteer/common/CallbackRegistry.js:98:16)
    at CallbackRegistry.create (/usr/local/lib/node_modules/@marp-team/marp-cli/node_modules/puppeteer-core/lib/cjs/puppeteer/common/CallbackRegistry.js:23:26)
    at Connection._rawSend (/usr/local/lib/node_modules/@marp-team/marp-cli/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/Connection.js:90:26)
    at CdpCDPSession.send (/usr/local/lib/node_modules/@marp-team/marp-cli/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/CDPSession.js:66:33)
    at NetworkManager.addClient (/usr/local/lib/node_modules/@marp-team/marp-cli/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/NetworkManager.js:62:20)
    at FrameManager.initialize (/usr/local/lib/node_modules/@marp-team/marp-cli/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/FrameManager.js:170:38)
    at #initialize (/usr/local/lib/node_modules/@marp-team/marp-cli/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/Page.js:290:36)
    at CdpPage._create (/usr/local/lib/node_modules/@marp-team/marp-cli/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/Page.js:103:31)
    at /usr/local/lib/node_modules/@marp-team/marp-cli/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/Target.js:206:42

Node.js v21.7.3
Command exited with non-zero status 1
real	3m 1.76s
user	0m 1.47s
sys	0m 0.49s
[  INFO ] Converting 1 markdown...
^CCommand exited with non-zero status 130
real	2m 3.37s
user	0m 1.14s
sys	0m 0.32s

$ podman run -it --rm healthy
========= VERSIONS =========
Chromium 124.0.6367.78 Alpine Linux
10.2.5
/usr/local/lib
`-- @marp-team/[email protected]

@marp-team/marp-cli v4.0.2 (w/ @marp-team/marp-core v4.0.0)
========= OUTPUTS =========
[  INFO ] Converting 1 markdown...
[  WARN ] Marp CLI has detected accessing to local files. They are blocked by security reason. Instead
          we recommend using assets uploaded to online. (Or you can use --allow-local-files option if
          you are understood of security risk)
[  INFO ] slides/slides.md => slides/slides.pdf
real	0m 6.63s
user	0m 1.72s
sys	0m 0.57s
[  INFO ] Converting 1 markdown...
[  WARN ] Marp CLI has detected accessing to local files. They are blocked by security reason. Instead
          we recommend using assets uploaded to online. (Or you can use --allow-local-files option if
          you are understood of security risk)
[  INFO ] slides/slides.md => slides/slides.pdf
real	0m 5.91s
user	0m 1.78s
sys	0m 0.53s
[...]

Expected behavior

The slides shoud be converted to PDF even with alpine 3.20.3 (and chromium 130)

Actual behavior

The slides are not converted to PDF. Instead, Marpit hangs and ends up stacktracing after 3 minutes.

Additional information

Feel free to ask for any information that I forgot to include in this report, and good luck in your debugging journey!

PS: I know the images referenced in the .md are missing in the container, but it has no effect on the bug whatsoever. I don't even know if the bug has anything to do with the table or the images. Feel free to edit the Markdown and check it on your side.

Metadata

Metadata

Assignees

No one assigned

    Labels

    upstreamCaused in upstream, not in this repo

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions