Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A Puppeteer test that fails only in headless mode is not automatically a React bug. First determine whether Chrome failed to launch, the page failed to load, or the page rendered and the assertion was wrong. Then compare the headless mode, browser version, executable path, Linux/container permissions, and CI resource limits. React-specific explanations should come only after those checks.

Start by classifying the failure

Save the complete browser stderr, the Puppeteer exception, any pageerror output, and the failing assertion. The first useful split is timing:

  • Chrome fails before Puppeteer connects: suspect a missing browser, an incompatible executable, missing Linux libraries, sandbox policy, or an unwritable profile/cache.
  • Chrome connects but navigation fails: inspect URL errors, timeouts, network interception, redirects, and application-server availability.
  • The page loads but an assertion fails: compare DOM, screenshots, console output, viewport, timing, and the selected headless implementation before changing React code.

Launch with browser output forwarded to the test process so an early Chrome error is not hidden:

const browser = await puppeteer.launch({
  headless: true,
  dumpio: true
});

Also collect page-level diagnostics:

page.on('console', msg => console.log('[browser]', msg.type(), msg.text()));
page.on('pageerror', error => console.error('[pageerror]', error));
page.on('requestfailed', request => {
  console.error('[requestfailed]', request.url(), request.failure());
});

A screenshot and serialized HTML taken immediately before the assertion often show whether the expected React component never mounted, mounted later than the test expected, or rendered a different state.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Logitech Brio 101 Full HD 1080p Webcam for Streaming and Meetings - Black
  • Compatible with Nintendo Switch 2’s new GameChat mode
  • Auto-Light Balance: RightLight boosts brightness by up to 50%, reducing shadows so you look your best—compared to previous-generation Logitech webcams (1)
  • Privacy with a Slide: The integrated webcam cover makes it easy to get total, reliable privacy when you're not on a video call
  • Built-In Mic: The built-in microphone lets others hear you clearly during video calls
  • Easy Plug-And-Play: The Brio 101 works with most video calling platforms, including Microsoft Teams, Zoom and Google Meet—no hassle; it just works

Know which “headless” browser you are running

Current Puppeteer uses new headless Chrome when headless: true is set. Puppeteer v22 changed the default from the older implementation. A separate chrome-headless-shell binary is selected with headless: 'shell'. It can be faster for automation that does not need the complete regular Chrome feature set, but it does not perfectly match regular Chrome. headless: false runs the normal visible browser and requires a display server in CI.

Setting What it launches Diagnostic use
headless: true New headless Chrome; current documented default Use as the normal baseline for current Puppeteer releases
headless: 'shell' Separate chrome-headless-shell binary Compare when shell-supported features are sufficient; do not assume identical behavior
headless: false Regular visible Chrome Useful comparison when a display server is available; CI generally needs Xvfb or another display server

Make the choice explicit in the test configuration. If a failure appears only in one mode, run the same test against all supported modes and record the browser version for each run. A mode difference can expose browser-feature or timing assumptions without implicating React.

Verify that a compatible browser is installed

When Puppeteer downloaded Chrome

The full puppeteer package normally downloads a compatible Chrome for Testing during installation. Package managers can block install scripts, especially in hardened CI or when an approval setting is enabled. In that case Puppeteer is present but its expected browser is absent. Install it explicitly:

npx puppeteer browsers install

Alternatively, allow Puppeteer’s installation script in the package manager and reinstall dependencies. Check the package-manager log and the Puppeteer cache rather than assuming that a successful JavaScript dependency install also installed Chrome.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

When using puppeteer-core

puppeteer-core intentionally does not download a browser. Supply an executable path or a browser channel:

Rank #2
Sale
Logitech C270 720p Webcam Plug-and-Play Wide Screen Video Calling - Black
  • Compatible with Nintendo Switch 2’s new GameChat mode
  • Crisp HD 720p/30 fps video calls with diagonal 55° field of view and auto light correction. Compatible with popular platforms including Skype and Zoom.
  • The built-in noise-reducing mic makes sure your voice comes across clearly up to 1.5 meters away, even if you’re in busy surroundings.
  • C270’s RightLight 2 feature adjusts to lighting conditions, producing brighter, contrasted images to help you look good in all your conference calls.
  • The adjustable universal clip lets you attach the camera securely to your screen or laptop, or fold the clip and set the webcam on a shelf. You’re always ready for your next video call.
const browser = await puppeteer.launch({
  executablePath: process.env.CHROME_BIN,
  headless: true,
  dumpio: true
});

Fail fast when the variable is missing, and print the resolved path in CI. A path that exists on a developer laptop may not exist in a container or a different runner image.

Check the pairing

Puppeteer works best with the Chrome for Testing version it manages. Compatibility with an arbitrary system Chrome is not guaranteed. Record all of these values in the failing job:

  • Installed Puppeteer version (and whether it is puppeteer or puppeteer-core)
  • Chrome executable path or selected channel
  • Actual browser version reported by the executable
  • Explicit headless value
  • Package manager and whether install scripts were permitted

Do not “fix” a mismatch by adding random launch flags. Use the browser Puppeteer expects, or deliberately manage and verify the pair as part of the build.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Linux and container failures happen before React runs

Missing shared libraries

Minimal Linux images often omit libraries required by Chrome. The resulting message can look like a generic launch failure because Puppeteer never establishes a connection. Inspect the complete Chrome stderr and install the libraries required by your chosen runner image. Reproduce in the same image locally when possible; a test that passes on a full workstation says little about a slim CI image.

Sandbox and user-namespace policy

Chrome’s sandbox depends on kernel and container policy. Ubuntu AppArmor conditions, disabled user namespaces, and restrictive container security profiles can prevent startup. Diagnose the host policy and its audit logs first. Puppeteer strongly discourages disabling the sandbox; using --no-sandbox should be a security-sensitive last resort for trusted content, not a default CI flag.

Rank #3
Sale
NexiGo N60 1080P Webcam with Microphone, Software Control & Privacy Cover, USB HD Computer Web Camera, Plug and Play, for Zoom/Skype/Teams, Conferencing and Video Calling
  • 【Full HD 1080P Webcam】Powered by a 1080p FHD two-MP CMOS, the NexiGo N60 Webcam produces exceptionally sharp and clear videos at resolutions up to 1920 x 1080 with 30fps. The 3.6mm glass lens provides a crisp image at fixed distances and is optimized between 19.6 inches to 13 feet, making it ideal for almost any indoor use.
  • 【Wide Compatibility】Works with USB 2.0/3.0, no additional drivers required. Ready to use in approximately one minute or less on any compatible device. Compatible with Mac OS X 10.7 and higher / Windows 7, 8, 10 & 11 / Android 4.0 or higher / Linux 2.6.24 / Chrome OS 29.0.1547 / Ubuntu Version 10.04 or above. Not compatible with XBOX/PS4/PS5.
  • 【Built-in Noise-Cancelling Microphone】The built-in noise-canceling microphone reduces ambient noise to enhance the sound quality of your video. Great for Zoom / Facetime / Video Calling / OBS / Twitch / Facebook / YouTube / Conferencing / Gaming / Streaming / Recording / Online School.
  • 【USB Webcam with Privacy Protection Cover】The privacy cover blocks the lens when the webcam is not in use. It's perfect to help provide security and peace of mind to anyone, from individuals to large companies. 【Note:】Please contact our support for firmware update if you have noticed any audio delays.
  • 【Wide Compatibility】Works with USB 2.0/3.0, no additional drivers required. Ready to use in approximately one minute or less on any compatible device. Compatible with Mac OS X 10.7 and higher / Windows 7, 10 & 11, Pro / Android 4.0 or higher / Linux 2.6.24 / Chrome OS 29.0.1547 / Ubuntu Version 10.04 or above. Not compatible with XBOX/PS4/PS5.

Writable profile and cache paths

Chrome needs writable locations for its profile and cache. Read-only filesystems, a non-writable home directory, or an unwritable temporary directory can cause startup or navigation failures. Give the test user a writable workspace and temporary directory, and avoid sharing one mutable profile between parallel jobs.

Visible mode needs a display

If you compare with headless: false on CI, provide a display server such as Xvfb. Without one, visible Chrome fails for an environmental reason unrelated to the React application. Keep the display setup separate from the browser-mode comparison so a missing DISPLAY variable does not obscure the original diagnosis.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Separate CI capacity problems from application problems

Headless browsers consume memory, processes, file descriptors, and CPU. A container can terminate Chrome or Jest workers under load even though one local run is stable. Look for out-of-memory events, process-limit errors, and runner-level termination messages. Compare the number of browser instances and Jest workers with the actual container limits.

Puppeteer’s troubleshooting guidance gives limiting Jest to two workers as an example for a particular constrained environment:

jest --maxWorkers=2

That number is not universal. Measure the runner, then choose a worker count that leaves capacity for each browser and your application server. If failures disappear when workers are reduced, treat that as evidence of resource contention, not proof of a React race.

Rank #4
Sale
EMEET C960 1080P Webcam with Microphone, 2 Mics, 90° FOV, Computer Camera
  • 1080P Webcam with Cover for Video Calls - EMEET computer webcam provides design and Optimization for professional video streaming. Realistic 1920 x 1080p video, 5-layer anti-glare lens, providing smooth video. C960 computer camera delivers 1920x1080 video with fixed focus (11.8–118.1 inches), so as to provide a clearer image. C960 USB webcam has a cover and can be removed automatically to meet your needs for privacy. For optimal image performance, use the webcam in a well-lit environment.
  • Built-in 2 Omnidirectional Mics - EMEET webcam with microphone for desktop features 2 built-in omnidirectional microphones, picking up your voice to create clear audio for communication. When installing the webcam, select EMEET C960 as the default microphone input device in your computer and video applications and select C960 as the default device in Zoom/Teams and ensure microphone permissions are enabled for proper use. Please note that C960 does not include built-in speakers.
  • Automatic Light Adjustment - Automatic exposure adjustment is applied in EMEET HD webcam 1080p so that the streaming webcam can deliver stable image performance. EMEET C960 camera for computer also features color adjustment and exposure optimization to help you look your best. For optimal video quality, it is recommended to use the webcam in normal or well-lit environments and select suitable video settings in your application. Proper lighting helps achieve a clearer and more balanced image.
  • Plug-and-Play & Upgraded USB Connectivity - New C960 webcam features both USB Type-A & A-to-C adapter connections for wider compatibility. For stable performance, connect the webcam directly to the computer's main USB port and ensure the device is recognized correctly. If a hub or docking station is used, please ensure it provides sufficient power and stable data transmission, as limited ports may affect performance. 90° wide-angle lens captures more participants without frequent adjustments.
  • High Compatibility & Multi Application - C960 webcam for laptop is compatible with Windows 10/11, macOS 10.14+, and Android TV 7.0+. Not supported: Windows Hello, TVs, tablets, or game consoles. It works with Zoom, Teams, Facetime, Google Meet, YouTube and more. Please select C960 webcam as the default camera and microphone device in your application and ensure camera/microphone permissions are enabled, especially on macOS. (Tips: Incompatible with Windows Hello)

Use a repeatable diagnostic sequence

  1. Capture evidence. Preserve stderr, Puppeteer exceptions, page errors, console messages, failed requests, URL, timeout values, and the assertion output.
  2. Identify the phase. Mark whether failure occurs during puppeteer.launch, page.goto, application rendering, or assertion.
  3. Record the runtime. Print Puppeteer version, browser path/channel, browser version, headless setting, package manager, operating system, container image, and worker count.
  4. Verify installation. For puppeteer, confirm the managed Chrome exists; run npx puppeteer browsers install if installation scripts were blocked. For puppeteer-core, verify the explicit executable path.
  5. Compare modes. Run identical tests with headless: true, headless: 'shell' when supported by the test, and headless: false on a runner with a display.
  6. Check the host. Inspect shared-library errors, sandbox/AppArmor diagnostics, writable profile/cache directories, and display-server setup.
  7. Check capacity. Correlate intermittent failures with memory, process, and worker limits; reduce concurrency only as a measured experiment.
  8. Reproduce outside CI. Run the same container image and command locally or in a debug job, preserving the exact environment variables and browser binary.
  9. Investigate React last. Once browser and runner causes are excluded, inspect the specific component, network responses, loading state, and assertion timing.

React-specific checks only after the browser is healthy

The symptom “passes headed, fails headless” does not establish a React hydration, effect, or rendering bug. The researched Puppeteer guidance does not identify a React-specific cause without the application and test. At this stage, gather application evidence rather than guessing:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Wait for a meaningful application condition (for example, a selector that represents loaded data) instead of relying on a fixed short delay.
  • Confirm the test server is reachable from the browser process and that API requests are not failing or being redirected.
  • Compare viewport, device scale, timezone, locale, and permissions if the component intentionally branches on them.
  • Check that the assertion targets stable accessible text or attributes, not an animation frame or transient loading node.
  • Capture DOM and a screenshot in both modes at the same point in the test.

These checks explain a page-level difference; they do not replace launch and environment diagnostics.

A minimal diagnostic test

The following JavaScript test makes the mode and browser selection visible and records enough evidence to classify a failure:

const puppeteer = require('puppeteer');

(async () => {
  const mode = process.env.PUPPETEER_HEADLESS || 'true';
  const headless = mode === 'shell' ? 'shell' : mode === 'false' ? false : true;
  const browser = await puppeteer.launch({
    headless,
    executablePath: process.env.CHROME_BIN || undefined,
    dumpio: true
  });

  try {
    console.log('version:', await browser.version());
    const page = await browser.newPage();
    page.on('console', msg => console.log('[console]', msg.type(), msg.text()));
    page.on('pageerror', error => console.error('[pageerror]', error));
    page.on('requestfailed', request => console.error('[requestfailed]', request.url(), request.failure()));

    await page.goto('http://127.0.0.1:3000', {
      waitUntil: 'networkidle0',
      timeout: 60000
    });
    await page.screenshot({path: 'diagnostic.png', fullPage: true});
    console.log((await page.content()).slice(0, 2000));
  } finally {
    await browser.close();
  }
})();

Run it with PUPPETEER_HEADLESS=true, PUPPETEER_HEADLESS=shell, and, where a display is configured, PUPPETEER_HEADLESS=false. Use a URL that your test runner actually serves; a connection-refused error here is an application-server or networking issue, not a rendering difference.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If your goal is a clean screenshot rather than maintaining Chrome in a test runner, ScreenshotNeo provides a website screenshot API and MCP server. It accepts consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be disabled. Only clean shots are billed: bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and the response identifies the result with X-Page-Verdict and X-Billed headers.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

One GET request is enough:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

See the complete parameter list and response behavior in the ScreenshotNeo documentation. The same request in Python:

Best Value
Sale
Logitech C920x HD Pro PC Webcam Full 1080p/30fps Video - Black
  • Compatible with Nintendo Switch 2’s new GameChat mode
  • HD lighting adjustment and autofocus: The Logitech webcam automatically fine-tunes the lighting, producing bright, razor-sharp images even in low-light settings. This makes it a great webcam for streaming and an ideal web camera for laptop use
  • Advanced capture software: Easily create and share video content with this Logitech camera that is suitable for use as a desktop computer camera or a monitor webcam
  • Stereo audio with dual mics: Capture natural sound during calls and recorded videos with this 1080p webcam, great as a video conference camera or a computer webcam
  • Full HD 1080p video calling and recording at 30 fps. You'll make a strong impression with this PC webcam that features crisp, clearly detailed, and vibrantly colored video
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)

And 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}`);

ScreenshotNeo also offers an MCP server with take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients. It supports full-page and element captures, device and viewport settings, dark mode, retina scale, custom CSS/JavaScript, waits, click actions, request blocking, headers, cookies, user agents, timezone and geolocation, transparent backgrounds, resizing, cache TTLs, signed links, asynchronous webhooks, bulk capture of up to 100 URLs per call, a usage API, and an OpenAPI specification. Existing parameter names used by other screenshot APIs also work.

Plan Allowance Price
Free 1,000 shots/month $0; no card
Starter 3,000 shots $5
Growth 15,000 shots $15
Pro 60,000 shots $39
Scale 250,000 shots $99
Business 1,000,000 shots $249

Yearly billing provides two months free, and every feature is included on every plan. Create a free ScreenshotNeo account to get 1,000 screenshots a month with no card.

Common errors and targeted fixes

Symptom Likely cause First fix
Could not find Chrome or missing executable Install script was blocked, or puppeteer-core has no path Run npx puppeteer browsers install, permit the install script, or set and verify executablePath
Chrome exits immediately in a container Missing libraries, sandbox/user-namespace policy, or unwritable profile Read stderr, fix the image/security policy and writable directories; avoid --no-sandbox unless the trusted-content risk is understood
Works headed, fails with headless: 'shell' Shell is a different binary with different feature fidelity Use new headless Chrome or adjust the test to features supported by shell
Visible mode fails only in CI No display server Configure Xvfb or keep the test headless
Intermittent Jest or browser crashes Too many workers for memory/process limits Inspect runner limits and reduce workers as a measured test, such as --maxWorkers=2 in the documented constrained scenario
Page is blank or assertion finds no component Navigation/API failure, premature assertion, or an application state difference Inspect failed requests and page errors, wait for a meaningful selector, and compare captured DOM in each mode

Reliability and cost considerations

  • Pin the Puppeteer release and browser source in CI so a mutable runner image does not silently change the browser.
  • Prefer one known browser per job and isolate profile directories when tests run in parallel.
  • Keep launch diagnostics enabled in a debug job, even if normal logs are quieter.
  • Use explicit timeouts and meaningful readiness conditions; increasing every timeout can hide a dead server or a failing request.
  • Match worker count to memory and process limits before adding retries. Retries can make a capacity problem worse.
  • When screenshot-only work is better served outside the test runner, an API can remove browser-install and display-server maintenance; inspect verdict and billed headers so failed captures are distinguishable from successful ones.

FAQ

Did Puppeteer v22 make React tests fail?

It changed the default headless implementation to new headless Chrome. That can expose browser-environment differences, but the version change alone does not prove a React defect. Compare explicit modes and versions.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Should I always add --no-sandbox in Docker?

No. Diagnose sandbox and user-namespace policy first. Removing the sandbox is a security-sensitive exception, not a general Puppeteer remedy.

Is headless: 'shell' a drop-in replacement?

No. It launches a separate shell binary that may be faster for suitable automation but does not completely match regular Chrome. Use it only when the test’s required features are supported.

Why does a test pass locally but fail in CI?

CI may have a different browser installation, Linux libraries, sandbox policy, writable paths, display setup, or worker/resource limits. Compare those values before changing the React component.

Frequently Asked Questions

What should I log first when headless Puppeteer fails?

Log browser stderr with dumpio, the Puppeteer exception, browser version and executable path, pageerror, console output, failed requests, and the exact failing assertion.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Quick Recap

SaleBestseller No. 1
Logitech Brio 101 Full HD 1080p Webcam for Streaming and Meetings - Black
Logitech Brio 101 Full HD 1080p Webcam for Streaming and Meetings - Black
Compatible with Nintendo Switch 2’s new GameChat mode; Built-In Mic: The built-in microphone lets others hear you clearly during video calls
$24.99
SaleBestseller No. 2
Logitech C270 720p Webcam Plug-and-Play Wide Screen Video Calling - Black
Logitech C270 720p Webcam Plug-and-Play Wide Screen Video Calling - Black
Compatible with Nintendo Switch 2’s new GameChat mode
$16.89
SaleBestseller No. 5
Logitech C920x HD Pro PC Webcam Full 1080p/30fps Video - Black
Logitech C920x HD Pro PC Webcam Full 1080p/30fps Video - Black
Compatible with Nintendo Switch 2’s new GameChat mode; Fully compatible with Windows 11
$54.99

Can I use ScreenshotNeo for automated page images instead of Puppeteer?

Yes. Its GET API and MCP tools capture pages without managing a local Chrome process; cookie banners, popups and chat widgets are removed before capture, and failed or blank captures are not billed.

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.