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.

Karma: cannot start chrome

See original GitHub issue

For my angularjs project, trying to use karma+jamine for unit testing. I have installed karma @ local and trying to start from .bin folder. So i’m getting following issue; FYI I’m pasting folder structure along with,

ERROR,
C:\Workspace\node_modules\.bin>karma start ../../karma.conf.js
27 10 2015 09:57:06.461:WARN [karma]: No captured browser, open http://localhost:9876/
27 10 2015 09:57:06.486:INFO [karma]: Karma v0.13.11 server started at http://localhost:9876/
27 10 2015 09:57:06.500:INFO [launcher]: Starting browser Chrome
27 10 2015 09:57:07.111:ERROR [launcher]: Cannot start Chrome
27 10 2015 09:57:07.119:INFO [launcher]: Trying to start Chrome again (1/2).
27 10 2015 09:57:07.491:ERROR [launcher]: Cannot start Chrome
27 10 2015 09:57:07.493:INFO [launcher]: Trying to start Chrome again (2/2).
27 10 2015 09:57:08.234:ERROR [launcher]: Cannot start Chrome
27 10 2015 09:57:08.236:ERROR [launcher]: Chrome failed 2 times (cannot start).Giving up.
27 10 2015 09:57:08.633:INFO [Chrome 46.0.2490 (Windows 7 0.0.0)]: Connected on
socket PgWwwQDh6BZ7k9fpAAAA with id 74171654
27 10 2015 09:57:18.954:WARN [Chrome 46.0.2490 (Windows 7 0.0.0)]: Disconnected
(1 times), because no message in 10000 ms.
27 10 2015 09:57:18.957:ERROR [karma]: [TypeError: Cannot read property 'map' of
 undefined]TypeError: Cannot read property 'map' of undefined   at _render (C:\Workspace\node_modules\karma\lib\reporters\progress.js:51:26)
    at _refresh (C:\Workspace\node_modules\karma\lib\reporters\progress.js:55:34)
    at onBrowserComplete (C:\Workspace\node_modules\karma\lib\reporters\prog
ress.js:15:21)
    at null.<anonymous> (C:\Workspace\node_modules\karma\lib\events.js:13:22
)
    at emitOne (events.js:82:20)
    at emit (events.js:169:7)
    at null._onTimeout (C:\Workspace\node_modules\karma\lib\browser.js:50:15
)
    at Timer.listOnTimeout (timers.js:89:15)
Folder Structure,
node_modules
src
test
karma.conf
package.json

karma.conf
module.exports = function(config) {
  config.set({
    frameworks: ['jasmine'],
    plugins: [
        'karma-phantomjs-launcher',
        'karma-jasmine',
        'karma-coverage',
        'karma-chrome-launcher' ,
        'karma-firefox-launcher',
        'karma-requirejs',
        'karma-ie-launcher' 
    ],
    files: [
    'src/assets/js/angular.js',
        'src/assets/js/angular-mocks.js',
        'src/app/**/*.js',
        'test/*.js'
     ],
    preprocessors: {
        'src/app/**/*.js': ['coverage']
    },
    reporters: ['progress','coverage'],
    coverageReporter: {
        type: 'html',
        dir: 'coverage'
    },
    logLevel: config.LOG_INFO,
    browsers: ['Chrome'],
    singleRun: false
  });
};

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
trodriguescommented, Oct 14, 2016

Just came across this bug as well. Weirdly enough, this started happening once I turned autoWatch to false.

Here’s my config:

var _ = require('lodash');
var webpackCommonConfig = require('./webpack.common.js');

module.exports = function(config) {
  config.set({
    basePath: 'tests',
    frameworks: ['jasmine'],
    files: [
      '../src/utils/intl_polyfill.js',
      '*.spec.js'
    ],
    exclude: [],
    preprocessors: {
      '../src/*.js': ['webpack'],
      '../src/**/*.js': ['webpack'],
      '../locales/*.js': ['webpack'],
      '*.spec.js': ['webpack'],
      '*Data.js': ['webpack']
    },
    webpack: _.merge({
      devtool: 'inline-source-map'
    }, webpackCommonConfig),
    webpackMiddleware: {
      stats: 'errors-only'
    },
    reporters: ['progress'],
    port: 9876,
    colors: true,
    logLevel: config.LOG_ERROR,
    autoWatch: false,
    browsers: ['PhantomJS'],
    singleRun: false,
    concurrency: Infinity
  })
}
0reactions
maksimrcommented, Dec 10, 2017

@wvicioso @Dok11 we fixed javascript exception in karma

“TypeError: Cannot read property ‘map’ of undefined]TypeError: Cannot read property ‘map’ of undefined”

It doesn’t fix the reason why Chrome doesn’t start because in 90% it’s environment problem or problem in karma-chrome-launcher. Did you run karma with log level equals debug?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Karma - Chrome failed 2 times (cannot start). Giving up
Solved that issue for me and karma started to launch chrome. ... The reason of error is that Chrome doesn't support no-sandbox anymore....
Read more >
Fixing a Karma Issue With Chrome V93 | by Colton - Medium
We could work around this problem by using the browsers: ['ChromeHeadless'] in the Karma config file. Headless Chrome is a way to run...
Read more >
Jenkins + karma + Chrome not working after last update
Karma does still work when run on the machine itself, but since the update karma cannot capture chrome if kicked off by jenkins...
Read more >
karma-runner/karma - Gitter
Basically, I'm trying to run my chrome-headless tests in docker, using drone.io for it. ... [karma]: { Error: Cannot find module 'browserify' at...
Read more >
63. Install Puppeteer for adding Chrome Headless ... - YouTube
... how to install Puppeteer for adding the chrome headless browser for automating the Karma Testing ... Your browser can't play this video....
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