Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
A broken Puppeteer screenshot in GitHub Actions usually has one of three causes: Chrome never started, Puppeteer connected to a browser but the page was not ready, or the capture succeeded but targeted the wrong state or element. Separate those cases before changing your workflow. Record the complete error, runner image and architecture, Node and Puppeteer versions, output-file size, URL, and whether the image is missing, empty, or visually incorrect.
1. Classify the failure before changing code
| What you observe | Most likely area | First check |
|---|---|---|
| No file or a zero-byte file | Node process, browser launch, permissions, or path | Workflow logs, exit code, and the directory used by path |
| Chrome launch or connection error | Browser install, shared libraries, sandbox, cache, or writable directories | Full stderr and the installed browser path |
| Valid image, but blank, stale, or incomplete | Navigation and application readiness | URL, readiness condition, target selector, and page console output |
Do not treat a visually wrong image as proof that Chrome is broken. A browser can launch correctly while the application is still rendering, waiting for data, showing a consent dialog, or redirecting.
2. Use a readiness-aware screenshot call
Puppeteer documents a basic sequence: launch, create a page, navigate with an appropriate waitUntil condition, capture with page.screenshot(), then close the browser. Its screenshot guide demonstrates networkidle2, but that is not universal. Applications with polling, analytics, WebSockets, or long-lived requests may never become idle.
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch({ headless: true });
try {
const page = await browser.newPage();
await page.goto('https://example.com', {
waitUntil: 'networkidle2',
timeout: 60_000,
});
await page.screenshot({ path: 'artifacts/page.png', fullPage: true });
} finally {
await browser.close();
}
})();
Choose the condition that matches your page. domcontentloaded is useful when the document structure is enough; load waits for subresources; networkidle2 waits for a period with no more than two active connections. For a single-page application, wait for the state that proves rendering is complete instead of guessing from elapsed time.
#1 Best Overall
- CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
- INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
- THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
- WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
- A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents
Wait for an application signal
await page.goto('https://example.com/dashboard', { waitUntil: 'domcontentloaded' });
await page.waitForSelector('[data-testid="dashboard-ready"]', { timeout: 30_000 });
await page.screenshot({ path: 'artifacts/dashboard.png', fullPage: true });
If the target is one component, ElementHandle.screenshot() can capture it and attempts to scroll a hidden element into view. Confirm that the selector identifies the intended element and that it is visible, has dimensions, and contains the expected text before capturing.
3. Make the browser installation explicit
Package-manager install scripts can be disabled in CI. When that happens, Puppeteer may be present while its downloaded browser is absent. The documented recovery is to install the browser explicitly:
npx puppeteer browsers install
Run this after dependency installation and before the screenshot step. Ensure the install and execution steps use the same cache. Puppeteer v19 and later use ~/.cache/puppeteer by default; set PUPPETEER_CACHE_DIR when your workflow needs a different location.
- name: Install dependencies
run: npm ci
- name: Install Puppeteer browser
run: npx puppeteer browsers install
- name: Capture screenshot
env:
PUPPETEER_CACHE_DIR: ${{ runner.temp }}/puppeteer-cache
run: node screenshot.js
Use the same PUPPETEER_CACHE_DIR value for installation and capture. A cache restored under one path but executed under another appears to Puppeteer as a missing browser. The error text “Could not find expected browser locally” points to this class of problem.
Rank #2
- CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
- 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
- SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
- INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
- THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
4. Check runner support and Linux libraries
Chrome can be downloaded and still fail immediately because the runner lacks a shared library. For a Linux launch failure, Puppeteer recommends checking the Chrome binary with:
ldd /path/to/chrome | grep not
Install the missing packages for the actual runner image rather than copying an old Debian list into every job. Dependency names vary between Ubuntu, Debian, Fedora, openSUSE, architectures, and image revisions. Chromium maintains the current platform dependency information.
Puppeteer 25.12.0 system requirements document Node 22.12 or newer and Chrome for Testing support on the listed Debian/Ubuntu x64 and arm64, openSUSE/Fedora x64 and arm64, Windows, and macOS architectures. Match the Node version, Puppeteer version, browser channel, operating system, and architecture you really run; do not assume a local laptop combination is equivalent to the hosted runner.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
- name: Show runtime versions
run: |
node --version
npm --version
npx puppeteer --version
uname -a
5. Treat sandbox errors as security errors
Chrome’s Linux sandbox limits the damage that untrusted web content can cause. Puppeteer strongly discourages --no-sandbox. Use it only as a constrained workaround when the captured content is trusted and you understand the loss of isolation; it is not a general CI repair.
Rank #3
- Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
- Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
- Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
- In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
- Ultra-thin bezels: Maximize your viewing experience with thin bezels.
“No usable sandbox!” can also involve AppArmor interactions on Ubuntu 23.10 and newer with downloaded Chrome for Testing binaries. Prefer fixing the runner’s sandbox configuration or choosing a supported environment. If a temporary diagnostic launch is unavoidable, document it and remove the flag once the host issue is corrected.
6. Give Chrome writable directories
Startup writes profile, configuration, and cache data. Read-only containers, restricted mounts, or a user mismatch can make Chrome exit before Puppeteer connects. Create writable locations owned by the browser user and point the process at them:
- name: Prepare browser directories
run: mkdir -p "$RUNNER_TEMP/chrome-config" "$RUNNER_TEMP/chrome-cache" "$RUNNER_TEMP/chrome-profile"
- name: Run capture
env:
XDG_CONFIG_HOME: ${{ runner.temp }}/chrome-config
XDG_CACHE_HOME: ${{ runner.temp }}/chrome-cache
run: node screenshot.js
const browser = await puppeteer.launch({
headless: true,
userDataDir: process.env.RUNNER_TEMP + '/chrome-profile',
});
Do not share one profile between concurrent jobs. A unique temporary profile avoids lock contention and stale state.
7. Verify Puppeteer and browser versions
Puppeteer releases are tightly bundled with a specific browser release, according to its FAQ. Pin the package in your lockfile, run npm ci, and install the browser through that same Puppeteer version. Avoid mixing a system Chrome, a cached binary, and a different global Puppeteer unless you have deliberately validated the combination.
Rank #4
- CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
- SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
- MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
- KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
- INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient
8. Turn on diagnostics without leaking secrets
Set dumpio: true to forward browser-process output to the Node process. Puppeteer’s protocol debugging instructions also support NODE_DEBUG="puppeteer:*".
const browser = await puppeteer.launch({
headless: true,
dumpio: true,
});
- name: Diagnostic capture
env:
NODE_DEBUG: puppeteer:*
run: node screenshot.js
These logs can contain URLs, headers, page text, or other sensitive information. Restrict diagnostic runs, redact secrets, and avoid publishing raw logs or screenshots as public artifacts.
9. A GitHub Actions baseline
name: screenshots
on: [push]
jobs:
capture:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22.12.x
cache: npm
- run: npm ci
- run: npx puppeteer browsers install
- run: mkdir -p "$RUNNER_TEMP/chrome-config" "$RUNNER_TEMP/chrome-cache" "$RUNNER_TEMP/chrome-profile"
- name: Capture
env:
XDG_CONFIG_HOME: ${{ runner.temp }}/chrome-config
XDG_CACHE_HOME: ${{ runner.temp }}/chrome-cache
run: node screenshot.js
- uses: actions/upload-artifact@v4
if: always()
with:
name: screenshot-output
path: artifacts/
This is a starting point, not a universal workflow. Adjust Node, operating system, dependencies, readiness checks, and artifact paths to your repository.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Scan for outdated or missing drivers - takes under a minute3Clear out junk files and repair common Windows errors10. Troubleshooting by symptom
“Could not find expected browser locally”
- Run
npx puppeteer browsers installin the job. - Check that install and execution use the same
PUPPETEER_CACHE_DIR. - Confirm package-manager scripts were not disabled and that the lockfile is used.
Chrome exits with missing-library errors
- Run
ldd chrome | grep notagainst the binary actually launched. - Install dependencies for the runner’s distribution and architecture.
- Record the runner image because image updates can change available libraries.
“No usable sandbox!”
- Check host sandbox and AppArmor configuration first.
- Use a supported runner and user configuration.
- Do not make
--no-sandboxthe default; if used temporarily, limit it to trusted content and remove it after remediation.
Browser starts, but the image is blank or stale
- Log the final URL after navigation.
- Wait for a selector or application state, not only a fixed sleep.
- Check redirects, authentication, consent dialogs, lazy content, and viewport-dependent layouts.
- Capture page errors and console messages during diagnosis.
The process starts but cannot create a profile
- Set writable
XDG_CONFIG_HOMEandXDG_CACHE_HOME. - Pass a writable, unique
userDataDir. - Check ownership when the job switches users or runs in a container.
Local success, CI failure
- Compare Node, Puppeteer, browser, OS, architecture, and environment variables.
- Install the browser in CI instead of relying on a developer machine.
- Collect full Chrome stderr with
dumpiobefore changing flags.
Or skip the browser setup
ScreenshotNeo provides a website screenshot API and MCP server when you need a capture without maintaining Chrome in your workflow. A single GET request returns PNG, JPEG, WebP, or PDF. Before capture it accepts cookie or consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be disabled. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers report the page verdict and billing status.
cURL:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
Python:
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
Node.js:
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
See the ScreenshotNeo documentation for options such as full-page and element capture, device and viewport settings, lazy-image loading, custom CSS or JavaScript, waits, request blocking, headers, cookies, geolocation, PDFs, caching, signed links, asynchronous jobs, bulk capture, and usage reporting. Its MCP server exposes take_screenshot, get_page_info, and capture_pdf to Claude, Cursor, and other MCP clients.
Best Value
- 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
- 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
- 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.
The Free plan includes 1,000 screenshots per month with no card. Paid plans start at $5 for 3,000 screenshots; every feature is on every plan, and yearly billing gives two months free. Sign up for ScreenshotNeo.
References
- Puppeteer troubleshooting
- Puppeteer screenshots guide
- Puppeteer system requirements
- Puppeteer debugging guide
- Puppeteer FAQ
Frequently Asked Questions
What should I collect before asking for help with a failing workflow?
Provide the workflow YAML, runner image and architecture, Node and Puppeteer versions, complete Chrome stderr, and whether the output is missing, empty, or visually wrong. Remove credentials and sensitive page data.
Is networkidle2 always the right wait condition?
No. It is a documented example, but pages with persistent requests may never become idle. Prefer a readiness signal that represents your application’s completed state.
Should I add –no-sandbox to make CI pass?
Only as a tightly constrained diagnostic or workaround for trusted content. Puppeteer strongly discourages it because it removes an important Chrome security boundary.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

