Error: Failed to launch the browser process! Unable to open X display.
See original GitHub issueBug description
I am on a Windows 11 machine, running Puppeteer from Ubuntu 20.4 (WSL 2.0)
This is the standard boilerplate code to run things:
async function ssr(url) {
const browserHeadless = await puppeter.launch({
headless: true,
})
const page = await browserHeadless.newPage()
...
Everything seems to work just fine when the optional param headless is set to true.
However, when I want to test things with headless: false, things go belly up.
I have literally scoured the net, Stack Overflow, GitHub, including puppeteer troubleshooting, this issue, this other issue and other articles read online.
Puppeteer version
10.4.0
Node.js version
16.13.0
npm version
8.1.0
What operating system are you seeing the problem on?
Windows
Relevant log output
reject(new Error([
^
Error: Failed to launch the browser process!
[10270:10270:1103/133318.960840:ERROR:browser_main_loop.cc(1409)] Unable to open X display.
TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md
at onClose (/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:197:20)
at ChildProcess.<anonymous> (/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:188:79)
at ChildProcess.emit (node:events:402:35)
at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
Issue Analytics
- State:
- Created 2 years ago
- Comments:7
Top Results From Across the Web
Headful mode doesn't launch (Unable to open X display.) #5429
Headful mode doesn't launch (Unable to open X display.) #5429 ... Error: Failed to launch the browser process!
Read more >node.js - Puppeteer | Unable to open X display | Ubuntu 20.04
I am just assuming that you are executing this on a terminal only Ubuntu? In my case it was the Ubuntu Windows subsystem...
Read more >Puppeteer - Failed to launch the browser process! - DietPi
I've been trying all morning to solve this error and I can't find the solution. any ... Puppeteer - Failed to launch the...
Read more >Troubleshooting - Puppeteer
UnhandledPromiseRejectionWarning: Error: Failed to launch the browser process! This means that the browser was downloaded but failed to be extracted correctly.
Read more >puppeteer 在服务端报错:Unable to open X display - 码道人
报错信息:. (node:1) Error: Failed to launch the browser process! Fontconfig warning: "/etc/fonts/fonts.conf", ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
We ran into a similar issue, running with docker compose locally:
Using
"puppeteer": "13.1.2",, with manually installed chromium onnode:16.15.0-bullseye-slim.Setting:
Starting puppeteer like so:
EDIT: When running
chromium-browser --product-versionI only get:EDIT 2: Same issue with newer versions of puppeteer
Same issue as https://github.com/puppeteer/puppeteer/issues/8148