marp-team / marp-team/marp-cli

Feature Request: Allow Custom Puppeteer Launch Arguments

Open
#671 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
3.8k
Forks
194
Avg merge
2h 51m
Merged PRs (30d)
3

Description

Problem Description

Currently, marp-cli uses a predefined set of Puppeteer launch arguments that work well for most environments but fail when running inside AWS Lambda runtime. The hardcoded browser arguments don't account for the specific requirements and limitations of serverless environments like AWS Lambda.

Current Behavior

When running marp-cli in AWS Lambda, the PDF/image generation fails because:

The default Puppeteer launch arguments are not compatible with Lambda's sandboxed environment
Lambda requires specific Chrome/Chromium flags for proper execution
There's no way to customize or override the browser launch arguments

Expected Behavior

Users should be able to pass additional or custom Puppeteer launch arguments to make marp-cli work in restricted environments like AWS Lambda.

Proposed Solution

Add support for customizing Puppeteer launch arguments through one of these methods:

Option 1: Environment Variable

bashMARP_PUPPETEER_ARGS="--no-sandbox,--disable-setuid-sandbox,--disable-dev-shm-usage" marp --pdf presentation.md

Option 2: CLI Flag

bashmarp --pdf --puppeteer-args="--no-sandbox,--disable-setuid-sandbox" presentation.md

Option 3: Configuration File

json{
"puppeteer": {
"args": ["--no-sandbox", "--disable-setuid-sandbox", "--disable-dev-shm-usage"]
}
}
AWS Lambda Requirements
For AWS Lambda compatibility, these arguments are typically needed:
javascript{
args: [
'--no-sandbox',
'--disable-setuid-sandbox',
'--disable-dev-shm-usage',
'--disable-background-timer-throttling',
'--disable-backgrounding-occluded-windows',
'--disable-renderer-backgrounding',
'--single-process' // Sometimes needed depending on Lambda configuration
]
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file, test, or entry point is named in the issue. Start by locating marp-cli's Puppeteer launch configuration and existing CLI or configuration option handling; done means users can supply custom launch arguments and PDF/image generation works in restricted environments such as AWS Lambda.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.