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

An empty SVG or canvas screenshot usually comes down to one of two different problems: Puppeteer captured the wrong area, or the page had not finished drawing when the screenshot was taken. Check the element’s size and position, inspect screenshot bounds, and wait for an application-level “render complete” signal before capturing. A visible element or completed navigation alone does not guarantee that its pixels have been drawn.

1. Check that Puppeteer is capturing the right element and area

First confirm that the expected page and frame loaded, then check the target SVG or canvas. It should exist, be visible, have a nonzero bounding box, and fall within the screenshot region. Inspect the browser console and failed network requests too; they can reveal an application or asset-loading problem.

Puppeteer offers two useful capture scopes: page.screenshot() captures the page, while ElementHandle.screenshot() captures a specific element and scrolls it into view if needed. If one is blank, compare it with the other to help distinguish a capture-boundary problem from a rendering problem. See the Puppeteer screenshots guide.

Inspect the element’s geometry

Use waitForSelector to check that the element exists and, with visible: true, is visible. Then read its bounding box. A zero-width or zero-height box, or coordinates outside the intended capture area, are clues that the problem is layout or capture scope rather than canvas drawing.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Philips 24 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 241V8LB
  • 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
const target = await page.waitForSelector('#chart', { visible: true });
const box = await target.boundingBox();
console.log(box);

A bounding box confirms layout geometry, not that the browser has painted the SVG or canvas contents.

Review screenshot bounds

Check whether your screenshot call sets clip, fullPage, or captureBeyondViewport, and verify the viewport size. A clip can exclude the target; viewport capture can miss content outside the visible region. Puppeteer documents fullPage and captureBeyondViewport as false by default when no clip is specified. The screenshot options and their version-specific behavior are documented in the ScreenshotOptions reference.

Rank #2
Philips 22 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 221V8LB
  • 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

2. Verify that the page has finished drawing

Navigation completion is not the same as visual completion. A page may have loaded while client-side code is still drawing a chart, diagram, or other canvas content. Likewise, waiting for an element to be visible or for its layout to stabilize does not establish that its pixels are ready.

Prefer a signal from the page’s own application, such as a flag that is set only after drawing completes. Puppeteer’s waitForFunction can poll that condition. The following example is illustrative: the page must implement window.chartRenderComplete itself.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Dell 24 Monitor - SE2426H - 23.8-inch FHD (1920x1080) 144Hz 1ms Display, in-Plane Switching (IPS) Technology, AMD FreeSync™, TÜV 3-Star 2X HDMI, Tilt
  • 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.
await page.goto(url, { waitUntil: 'networkidle2' });
await page.waitForSelector('#chart', { visible: true });
await page.waitForFunction(() => window.chartRenderComplete === true);
await page.screenshot({ path: 'capture.png' });

networkidle2 is a navigation option, not proof that a later client-side render has completed. Avoid relying on a fixed delay when the application can expose a meaningful readiness condition. For the wait behavior available in your installed Puppeteer version, check its Page.waitForFunction reference.

3. Diagnose canvas dimensions and origin access

For canvas, inspect its intrinsic width and height, then cautiously test toDataURL() in the page. A zero-sized canvas—or one whose dimensions exceed the browser’s maximum canvas size—returns data:,. If the canvas is not origin-clean, reading it throws a SecurityError. These behaviors are documented by MDN’s toDataURL reference.

Rank #4
Sale
Samsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor
  • 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
const canvasInfo = await page.$eval('#chart canvas', canvas => {
  let dataUrlResult;
  try {
    dataUrlResult = canvas.toDataURL();
  } catch (error) {
    dataUrlResult = `${error.name}: ${error.message}`;
  }
  return {
    width: canvas.width,
    height: canvas.height,
    dataUrlResult: dataUrlResult === 'data:,' ? 'data:,' : dataUrlResult.slice(0, 40)
  };
});
console.log(canvasInfo);

Do not print or store a full data URL for a large canvas just to diagnose it. The short prefix check above distinguishes the documented data:, result without dumping image content. A successful read is useful evidence, but it does not by itself prove that the application drew the content you expected.

4. Wait for images used in canvas or SVG rendering

If the application draws an image into canvas with drawImage(), make sure the image has loaded first. Calling drawImage() before an image finishes loading does nothing, according to MDN’s canvas image tutorial.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Sale
Sceptre New 22-Inch Gaming Monitor, FHD 1080p, Up to 144Hz, HDMI, DisplayPort, Built-in Speakers, Machine Black (E225W-FW144 Series, 2026)
  • 【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.
await page.waitForFunction(() => {
  const image = document.querySelector('#chart-image');
  return image && image.complete && image.naturalWidth > 0;
});
// The application should draw the image after this condition is true.

If an SVG is being loaded as an image asset, check that its root <svg> has explicit width and height attributes. The MDN tutorial covers this requirement for SVG images.

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

5. Capture again and isolate the failure

  1. Confirm the page and frame are correct; note console errors and failed requests.
  2. Check that the SVG or canvas exists, is visible, and has nonzero layout dimensions.
  3. Inspect the viewport and screenshot options for a clip or capture boundary that excludes the target.
  4. For canvas, inspect intrinsic dimensions and the result or error from toDataURL().
  5. Wait for image assets to load before drawing them, and wait for an application-level render-complete signal before capture.
  6. Compare a page screenshot with an element screenshot to see whether capture scope changes the result.

If the element is correctly positioned but both captures remain empty, focus on application drawing readiness, canvas integrity, and missing assets rather than changing screenshot bounds blindly.

Or skip the browser setup

For a one-call screenshot instead of managing Puppeteer setup, use ScreenshotNeo. This example saves a WebP screenshot of the target URL:

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 ScreenshotNeo API documentation for request options. ScreenshotNeo removes cookie banners, newsletter popups, and chat widgets before the shot; bot checks, blank pages, and failed loads are not billed. Its MCP server lets AI agents take screenshots, and the free plan includes 1,000 screenshots per month with no card required; paid plans start at $5 for 3,000. Learn more at ScreenshotNeo, or sign up for the free plan.

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

Troubleshooting common symptoms

Symptom What to check Next step
Target is absent from the screenshot Element visibility, bounding box, viewport, and any clip setting Capture the element directly or adjust the capture region.
Element appears, but its canvas is blank Application render completion and canvas intrinsic dimensions Wait for the app’s completed-draw signal; check toDataURL() for data:,.
toDataURL() throws SecurityError Whether the canvas is origin-clean Investigate the origin of content drawn into the canvas; browser security prevents reading a non-origin-clean canvas.
Canvas image is missing Whether the source image finished loading before drawImage() Wait for its load state before the application draws it.
SVG loaded as an image is blank or has no expected size Root SVG dimensions Check that the root SVG specifies width and height.
Element and page captures are both empty Whether drawing completed and whether assets or application code failed Inspect the app’s readiness signal, console, and failed requests.

Version and diagnosis limits

The precise cause depends on the page’s markup and code, Puppeteer and Chrome versions, screenshot options, and any console or network errors. Check the references for the API version you use; the Puppeteer documentation may change between releases. The checks above identify likely categories of failure without assuming that one cause applies to every page.

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.