-
-
Notifications
You must be signed in to change notification settings - Fork 159
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
]
}