question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ERROR [launcher]: Cannot load browser "ChromeHeadless": it is not registered!

See original GitHub issue

Expected behaviour

after update of typescript, webpack, removing phantomJs and adding puppeteer tests will pass

Actual behaviour

when running tests, karma-launcher cannot load ChromeHeadless. and log this error:

16 01 2018 13:49:07.627:INFO [compiler.karma-typescript]: Compiling project using Typescript 2.6.2
16 01 2018 13:49:17.757:INFO [compiler.karma-typescript]: Compiled 132 files in 9499 ms.
16 01 2018 13:49:26.779:INFO [bundler.karma-typescript]: Bundled imports for 131 file(s) in 8510 ms.
16 01 2018 13:49:29.302:WARN [karma]: No captured browser, open http://localhost:9876/
16 01 2018 13:49:29.317:INFO [karma]: Front-end scripts not present. Compiling...
16 01 2018 13:49:36.550:INFO [karma]: Karma v2.0.0 server started at http://0.0.0.0:9876/
16 01 2018 13:49:36.550:INFO [launcher]: Launching browser ChromeHeadless with unlimited concurrency
16 01 2018 13:49:36.550:ERROR [launcher]: Cannot load browser "ChromeHeadless": it is not registered! Perhaps you are missing some plugin?
16 01 2018 13:49:36.550:ERROR [karma]: Found 1 load error
[13:49:36] Automated tests ended with FAILURE!!! error: process exited with code 1
  • Karma version: 2.0.0
  • Relevant part of your karma.config.js file
process.env.CHROME_BIN  =  require('puppeteer').executablePath()
module.exports = function(config) {
    config.set({
        karmaTypescriptConfig: {
            tsconfig: "./tsconfig.json",
            bundlerOptions: {
                exclude: [
                    "react/addons",
                    "react/lib/ExecutionEnvironment",
                    "react/lib/ReactContext",
                ]
            },
            coverageOptions: {
                instrumentation: true,
                exclude: /\.(d|spec|test)\.(ts|tsx)/i
            },
            reports: {
                "cobertura": {
                    "directory": "build_reports/coverage",
                    "filename": "coverage.xml",
                    "subdirectory": "cobertura"
                },
                "html": "build_reports/coverage",
                "text-summary": ""
            }
        },
        frameworks: ['mocha', 'karma-typescript'],
        files: [
            { pattern: '!(node_modules|Server|dist)/**/*.+(ts|tsx)' }
        ],
        "exclude": [
            "**/*.d.ts"
        ],
        preprocessors: {
            '!(node_modules|Server|dist)/**/*.+(ts|tsx)': 'karma-typescript',
        },
        reporters: ['progress', 'junit', 'mocha', 'karma-typescript'],

        junitReporter: {
            outputDir: 'build_reports/test-results',
            outputFile: 'test-results.xml'
        },

        browsers: ['ChromeHeadless'],
        plugins: [
            'karma-chrome-launcher',
            'karma-typescript',
            'karma-mocha',
            'karma-junit-reporter',
            'karma-mocha-reporter'
        ],
        singleRun: false,

        colors: true,

        logLevel: config.LOG_INFO,
    });
};

tried to have plugins inside plugin section or remove plugins section altogether with no success.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:13

github_iconTop GitHub Comments

7reactions
manoharreddyporeddycommented, Dec 20, 2018

I am getting same error with version 2.2.0 of 'karma-chrome-launcher'. Any solutions?

Same with me.

5reactions
swetapatil1commented, Sep 27, 2018

I am getting same error with version 2.2.0 of 'karma-chrome-launcher'. Any solutions?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular cli ChromeHeadless karma still open a browser
When I remove it I'm getting Cannot load browser "ChromeHeadless": it is not registered! Perhaps you are missing some plugin? – undefined. Mar ......
Read more >
Cannot load browser "ChromeHeadless": it is not registered!
ERROR [launcher]: Cannot load browser "ChromeHeadless": it is not registered!
Read more >
karma-chrome-launcher - npm
A Karma plugin. Launcher for Chrome and Chrome Canary.. Latest version: 3.1.1, last published: 10 months ago.
Read more >
Cannot load browser ChromeHeadless'': it is not registered ...
The ChromeHeadless launcher is great because it works out of the box for testing on Headless Chrome. It includes the appropriate Chrome flags...
Read more >
Browsers - Karma test runner
Install the launcher first with npm: $ npm install karma-firefox-launcher --save-dev. And then, inside your configuration file, add the browser name in ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found