Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
There are two reliable ways to see output from headless Chrome: connect a visible Chrome DevTools window to the headless process, or forward browser-page events from Puppeteer into Node.js. Use remote DevTools when you need to inspect a live page interactively. Use Puppeteer listeners when you need repeatable logs in an automation run. Add pageerror for uncaught JavaScript exceptions, requestfailed for network-layer failures, and dumpio: true for Chrome process startup or crash output.
Choose the diagnostic stream first
“Chrome errors” can describe several different things. Separating them prevents a misleading diagnosis:
| What you need | Use | What it reveals |
|---|---|---|
| Inspect a running headless page interactively | Chrome remote debugging plus chrome://inspect |
DevTools Console, sources, stacks and live page context |
| Record messages produced by page JavaScript | Puppeteer page.on('console') |
console.log, warnings, errors and other ConsoleMessage events |
| Capture uncaught JavaScript exceptions | Puppeteer page.on('pageerror') |
Exceptions that escape page code |
| Diagnose Chrome launch or process crashes | Puppeteer dumpio: true |
Browser-process logs forwarded to Node standard streams |
| Diagnose failed network operations | requestfailed, plus response status inspection |
Transport failures separately from HTTP status codes |
Method 1: inspect headless Chrome with DevTools
This method gives you a normal DevTools interface for a page that is running without a visible browser window. The headless process prints a WebSocket endpoint, and a separate headful Chrome instance connects to it.
Recommended Free Tools
- Start Chrome with remote debugging enabled. The following command asks Chrome to choose an available port and print its endpoint:
chrome --headless --remote-debugging-port=0 https://developer.chrome.com/
- Copy the DevTools WebSocket URL and the address/port printed by Chrome.
- In a visible Chrome window, open
chrome://inspect. - Select Configure, enter the address and port from the headless endpoint, and confirm.
- Choose the discovered target and click Inspect. DevTools opens with the page’s Console, source links, stack traces and other panels.
Keep the debugging endpoint local or otherwise access-controlled in the environment where Chrome runs. A remote debugging port exposes a powerful inspection interface; do not publish it openly on an untrusted network.
#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
Make Console output survive navigation
In DevTools, enable Preserve log when a redirect or reload would otherwise clear messages. Use the severity filters—Verbose, Info, Warning and Error—to narrow a noisy session. Error entries generally include a stack trace and a source link; selecting those links takes you to the originating script and line.
Method 2: forward page logs from Puppeteer to Node.js
Page JavaScript and Node.js run in different contexts. A page’s console.log() is not automatically printed in the terminal running Puppeteer. Register listeners before navigation or before the interaction that triggers the message.
import puppeteer from 'puppeteer';
const browser = await puppeteer.launch();
const page = await browser.newPage();
page.on('console', msg => {
console.log(`[page console:${msg.type()}]`, msg.text());
});
page.on('pageerror', error => {
console.error('[uncaught page error]', error);
});
await page.goto('https://example.com', { waitUntil: 'load' });
// Run interactions that may produce output here.
await browser.close();
The console event supplies a Puppeteer ConsoleMessage. Its type identifies categories such as log, warn and error; msg.text() returns the rendered message text. The separate pageerror event carries an uncaught page exception. A console error is a message emitted by code; a page error is an exception that was not handled.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchCapture arguments and locations when text is not enough
Applications often log objects, multiple arguments or values that stringify poorly. Start with msg.text() for a compact transcript, then inspect the ConsoleMessage API available in your installed Puppeteer version for argument and location access when you need structured values or source positions. Keep the listener lightweight so logging does not change timing-sensitive behavior.
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
Register before the event can occur
Listeners added after goto(), a click, or an evaluated script can miss messages emitted during that operation. Create the page, attach every relevant listener, and only then navigate or interact.
Capture Chrome’s own process output with dumpio
Page listeners do not explain every failure. If Chrome cannot start, exits unexpectedly or crashes at the process level, forward the browser process’s standard streams:
import puppeteer from 'puppeteer';
const browser = await puppeteer.launch({ dumpio: true });
const page = await browser.newPage();
page.on('console', msg => console.log(`[page:${msg.type()}] ${msg.text()}`));
page.on('pageerror', error => console.error('[pageerror]', error));
await page.goto('https://example.com');
await browser.close();
dumpio: true serves a different purpose from page.on('console'): it forwards browser-process logs to Node’s standard output and error streams. Enable it when the symptom occurs before a page exists or when Chrome itself terminates.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Do not confuse JavaScript, network and HTTP errors
JavaScript console messages
These are explicit calls such as console.warn() or console.error(). Capture them with the console event. They may indicate a problem, but they do not necessarily stop execution.
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.
Uncaught page exceptions
These arrive through pageerror. They represent thrown errors that were not caught by page code and are usually the most direct signal of a broken script.
Request failures
Puppeteer’s requestfailed event is for a request that fails at the network or transport layer. The request’s failure() method may contain text such as net::ERR_FAILED, but failure text is not guaranteed.
page.on('requestfailed', request => {
const failure = request.failure();
console.error('[request failed]', request.url(), failure?.errorText);
});
HTTP 404, 503 and other response statuses
An HTTP error status is still a completed request. A 404 or 503 therefore does not automatically trigger requestfailed. Inspect responses and status codes independently:
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Fix the driver behind crashes, sound loss and screen glitches3Clear out junk files and repair common Windows errorspage.on('response', response => {
if (response.status() >= 400) {
console.error('[http status]', response.status(), response.url());
}
});
Use all three streams when necessary: page events for JavaScript behavior, request events for transport failures, and responses for server-returned status codes.
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
A complete diagnostic script
This script records the main categories in one run and keeps the listeners active before navigation:
import puppeteer from 'puppeteer';
const browser = await puppeteer.launch({ dumpio: process.env.DUMPIO === '1' });
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()?.errorText ?? 'no failure text');
});
page.on('response', response => {
if (response.status() >= 400) {
console.error('[http]', response.status(), response.url());
}
});
try {
const response = await page.goto('https://example.com', { waitUntil: 'networkidle0', timeout: 30000 });
console.log('[navigation]', response?.status(), page.url());
// Put clicks, form submissions or evaluate calls here.
} finally {
await browser.close();
}
Use a timeout appropriate for the site. networkidle0 can wait indefinitely on applications that maintain long-lived connections; switch to load or domcontentloaded when that behavior is expected.
Troubleshooting common failures
Nothing from console.log appears in Node
- Confirm the message is emitted by the page, not by Node code.
- Attach
page.on('console', ...)beforegoto()or the triggering action. - Check that the code path actually runs; add a temporary page-side marker if necessary.
Errors appear in DevTools but not the automation transcript
Add both console and pageerror. Console messages and uncaught exceptions are separate event streams. Also verify that your listener is attached to the same Page target that produces the output.
There is no visible DevTools window
Headless Chrome does not create a local DevTools window. Start it with --remote-debugging-port, then connect from a separate visible Chrome instance through chrome://inspect.
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.
requestfailed never fires for a 404
That is expected: 404 is an HTTP response, not a transport failure. Inspect the response event and its status code.
Chrome exits before a page is created
Launch with dumpio: true and read Node’s standard output and error streams. This captures browser-process diagnostics that page listeners cannot receive.
Logs vanish after a reload
Enable Preserve log in DevTools before navigating. Without it, navigation can clear the Console.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Performance and reliability practices
- Attach listeners once per page and write structured records to a file or test reporter rather than printing unbounded object dumps.
- Include event type, URL, timestamp and (where available) source information so parallel pages can be distinguished.
- Use bounded navigation and action timeouts. A timeout is an automation failure; it is not automatically a page JavaScript exception.
- Close the browser in a
finallyblock so a failing assertion does not leave Chrome processes running. - When diagnosing intermittent failures, preserve the first occurrence of each category and the surrounding action, rather than flooding logs with repeated polling messages.
Or skip the browser setup
ScreenshotNeo provides a website screenshot API and MCP server when you need a rendered page image or PDF without managing Chrome yourself. Its capture pipeline accepts consent banners and removes more than 60 known consent platforms, newsletter popups and chat widgets before the shot; each step can be disabled. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads and cache hits are not billed, and response headers identify the page verdict and billing result. AI agents can use its MCP tools—take_screenshot, get_page_info and capture_pdf—from Claude, Cursor or another MCP client.
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 ScreenshotNeo documentation for options and response behavior. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 screenshots. Create a free ScreenshotNeo account.
FAQ
Can headless Chrome show a console window by itself?
No. Use remote debugging and connect from a visible Chrome window, or forward events into your automation process.
Should I use pageerror or console?
Use console for messages emitted by page code and pageerror for uncaught exceptions. They complement each other.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Does a failed HTTP status prove the browser request failed?
No. A 4xx or 5xx response completed at the HTTP layer. Check requestfailed separately for transport failures.
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.

