Ubuntu: Cannot start ChromeHeadless
See original GitHub issueI’m having some trouble getting ChromeHeadless to start. The error message doesn’t give much information:
22 03 2018 18:05:33.296:INFO [karma]: Karma v1.4.1 server started at http://0.0.0.0:9877/
22 03 2018 18:05:33.296:INFO [launcher]: Launching browser ChromeHeadless with unlimited concurrency
22 03 2018 18:05:33.320:INFO [launcher]: Starting browser ChromeHeadless
22 03 2018 18:05:33.404:ERROR [launcher]: Cannot start ChromeHeadless
22 03 2018 18:05:33.409:INFO [launcher]: Trying to start ChromeHeadless again (1/2).
22 03 2018 18:05:33.631:ERROR [launcher]: Cannot start ChromeHeadless
22 03 2018 18:05:33.634:INFO [launcher]: Trying to start ChromeHeadless again (2/2).
22 03 2018 18:05:34.008:ERROR [launcher]: Cannot start ChromeHeadless
22 03 2018 18:05:34.009:ERROR [launcher]: ChromeHeadless failed 2 times (cannot start). Giving up.
Here is my karma config:
process.env.CHROME_BIN = require('puppeteer').executablePath() //for using ChromeHeadless
module.exports = function(config) {
config.set({
plugins: [
require("karma-jasmine"),
require("karma-typescript"),
require("karma-chrome-launcher"),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter')
],
frameworks: ["jasmine", "karma-typescript"],
basePath: './',
files: [
'node_modules/es6-shim/es6-shim.js',
'node_modules/babel-polyfill/dist/polyfill.js',
'node_modules/reflect-metadata/Reflect.js',
// zone.js
'node_modules/zone.js/dist/zone.js',
'node_modules/zone.js/dist/long-stack-trace-zone.js',
'node_modules/zone.js/dist/proxy.js',
'node_modules/zone.js/dist/sync-test.js',
'node_modules/zone.js/dist/jasmine-patch.js',
'node_modules/zone.js/dist/async-test.js',
'node_modules/zone.js/dist/fake-async-test.js',
'node_modules/resumablejs/resumable.js',
'node_modules/hls.js/dist/hls.min.js',
'src/assets/third-party/three.js',
'src/assets/third-party/obj-loader.js',
'src/assets/third-party/OrbitControls.js',
'src/assets/third-party/THREEx.Fullscreen.js',
{ pattern: "src/app/**/*.html" },
{ pattern: "src/**/*.ts" }
],
preprocessors: {
"src/**/*.ts": ["karma-typescript"],
"!node_modules": ["karma-typescript"]
},
client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
reporters: ['progress', 'kjhtml', 'coverage-istanbul'],
browsers: ["ChromeHeadless"],
coverageIstanbulReporter: {
reports: ['html', 'text-summary'],
dir: 'coverage',
skipFilesWithNoCoverage: false
},
karmaTypescriptConfig: {
bundlerOptions: {
entrypoints: /\.spec\.ts$/,
transforms: [
require("karma-typescript-angular2-transform"),
require("karma-typescript-es6-transform")({ presets: ['es2015'] })
]
},
compilerOptions: {
emitDecoratorMetadata: true,
experimentalDecorators: true,
module: "commonjs"
},
coverageOptions: {
exclude: [
/\.(d|spec|test)\.ts$/i,
/main.ts$/i,
/polyfills.ts$/i,
/app.component.ts$/i,
/app.routes.ts$/i,
/module.ts$/i,
/Service.ts$/i
],
},
tsconfig: "./tsconfig.json"
}
});
};
Any suggestions?
I’m on Ubuntu 16.04 and Chrome 62.
Issue Analytics
- State:
- Created 5 years ago
- Comments:8
Top Results From Across the Web
Cannot start ChromeHeadless in Angular project using WSL ...
Method 3: This will help run puppetteer on Ubuntu, so let's install necessary packages: sudo apt-get install gconf-service libasound2 ...
Read more >Building on Ubuntu - Cannot start ChromeHeadless
Hi all, I am building Sakai on ubuntu, and getting the following error: [INFO] 18 05 2021 12:26:49.803:INFO [launcher]: Starting browser ChromeHeadless
Read more >Cannot start ChromeHeadless | Bitbucket Cloud - Jira
Since 27-02-2019 our Frontend UnitTests fail in Bitbucket pipeline with the following error: Testing GD.ProgramProcessing.WebUI... yarn run v1.12.3
Read more >Troubleshooting - Puppeteer
Chromium currently does not provide arm64 binaries for Linux. There are only binaries. ... Chrome headless doesn't launch on Windows.
Read more >63. Install Puppeteer for adding Chrome Headless browser in ...
In this video we will see how to install Puppeteer for adding the chrome headless browser for ... Your browser can't play this...
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 FreeTop 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
Top GitHub Comments
@raveneyex I’ve defined a custom launcher based on ChromiumHeadless. The custom launcher allows flags to be passed to the Chrome (or Chromium) instance.
for me it says, [INFO] [0518/130005.862638:ERROR:zygote_host_impl_linux.cc(90)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
I’ve done everything also provided different flags from issues but still couldn’t launch chrome headless on Ubuntu 22.04