Puppeteer prints a yellow old Headless warning every time it launches
Fix it fast
Most common cause, 1 of 3The project runs Puppeteer 19.11 to 21.x, where true still meant the old mode
Move to the current major.
npm install puppeteer@latest
// launch code for Puppeteer 22 and later
const browser = await puppeteer.launch({ headless: true });Short answer
Puppeteer 19.11 to 21.x prints the old Headless deprecation warning when headless is true or left out, because in those releases true still started Chrome's old Headless mode. Upgrade to Puppeteer 22 or later (25.18 now), where true already means the new mode, and remove any headless: 'new'. Pick headless: 'shell' only to keep the old chrome-headless-shell behaviour.
Which cause do you have?
Ask npm which Puppeteer the project really resolves, then list every line that sets a headless value or flag. Below 22 means cause 1. Version 22 or newer with 'new' in the code means cause 2. A --headless=old argument means cause 3.
npm ls puppeteer puppeteer-core
grep -rnE "headless" --include=*.js --include=*.mjs --include=*.cjs --include=*.ts --exclude-dir=node_modules .Then find the line you see in this list and open its fix:
- 1The project runs Puppeteer 19.11 to 21.x, where true still meant the old mode
npm ls prints a 19.11, 20.x or 21.x version, and launch() gets headless: true or no headless option at all - 2The code was upgraded but still passes headless: 'new'
Puppeteer is 22 or newer, and the TypeScript compiler complains about the headless line - 3The script forces old Headless with a --headless=old Chrome flag
The launch args contain --headless=old, and the browser stopped starting in old Headless after a Chrome update
What does the error look like?
Puppeteer old Headless deprecation warning:In the near future `headless: true` will default to the new Headless mode for Chrome instead of the old Headless implementation.Consider opting in early by passing `headless: "new"` to `puppeteer.launch()`
Cause 1 of 3
The project runs Puppeteer 19.11 to 21.x, where true still meant the old mode
You seenpm ls prints a 19.11, 20.x or 21.x version, and launch() gets headless: true or no headless option at all
Check
The old Headless deprecation warning is printed by the Chrome launcher of Puppeteer 19.11 to 21.x whenever headless resolves to true. An empty launch() resolves to true as well, so the plain default call shows it. Release 22.0.0 lists the new Headless mode becoming the default as a breaking change.
npm ls puppeteerFix
Move to the current major. From 22.0.0 on, true starts the new Headless mode and no warning is printed. The same release renamed createIncognitoBrowserContext to createBrowserContext and removed $x, so read the breaking changes first. When the upgrade has to wait, passing headless: 'new' on the old version opts in early, and setting PUPPETEER_DISABLE_HEADLESS_WARNING to any value hides the block.
npm install puppeteer@latest
// launch code for Puppeteer 22 and later
const browser = await puppeteer.launch({ headless: true });Verify
npm ls now shows 25.x, and a launch prints nothing in yellow before your own output.
npm ls puppeteer
node index.jsConfirmed by raw.githubusercontent.com
Cause 2 of 3
The code was upgraded but still passes headless: 'new'
You seePuppeteer is 22 or newer, and the TypeScript compiler complains about the headless line
Check
The 'new' value only existed so people could opt in before the switch. In the current LaunchOptions reference, headless accepts boolean | 'shell', where true is the new mode and 'shell' is the old one. A leftover 'new' no longer matches that type, so a TypeScript build stops there.
grep -rn "headless: *['\"]new" --include=*.ts --include=*.js --exclude-dir=node_modules .Fix
Change 'new' to true, or delete the option, since true is already the default.
// Puppeteer 19.11 to 21.x opt-in
// const browser = await puppeteer.launch({ headless: 'new' });
// Puppeteer 22 and later
const browser = await puppeteer.launch({ headless: true });Verify
The type check finishes with no error on the launch call.
npx tsc --noEmitConfirmed by pptr.dev
Cause 3 of 3
The script forces old Headless with a --headless=old Chrome flag
You seeThe launch args contain --headless=old, and the browser stopped starting in old Headless after a Chrome update
Check
Chrome 132 took the old Headless mode out of the Chrome binary. From that release, --headless=old prints an error message instead of starting a browser. The old implementation survives only as the standalone chrome-headless-shell binary.
grep -rn "headless=old" --exclude-dir=node_modules .Fix
Delete the flag and let Puppeteer choose the binary. headless: true gives the new mode inside Chrome. headless: 'shell' gives chrome-headless-shell, which Puppeteer's guide calls more performant for automation that does not need the full Chrome feature set. Puppeteer downloads the shell at install time; if CI sets PUPPETEER_SKIP_CHROME_HEADLESS_SHELL_DOWNLOAD, remove it and fetch the browsers again.
// delete args: ['--headless=old'] and ask for the shell instead
const browser = await puppeteer.launch({ headless: 'shell' });Verify
After the browsers install step, the script launches, takes its screenshot or PDF, and exits without the Chrome error.
npx puppeteer browsers install
node index.jsConfirmed by developer.chrome.com
How do I stop it coming back?
- Pin puppeteer to an exact version and read the BREAKING CHANGES list in its changelog before every major bump.
- Create the browser in one shared launch helper so a headless change is a single edit.
- Add a type-check step (npx tsc --noEmit) to every pull request, so an option value Puppeteer dropped breaks the build early rather than a nightly job.
- Leave the chrome-headless-shell download switched on in CI images whenever any job uses headless: 'shell'.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.