Karma: Karma v2.0.3 TypeError: Cannot read property 'markCaptured' of undefined

Created on 18 Jun 2018  路  7Comments  路  Source: karma-runner/karma

When you start running tests using Karma 2.0.3 and clear the url during tests. To start from clean point. Karma fails to Javascript error

Expected behaviour

Karma should start from beginning

Actual behaviour

Karma crashes and browser closes

Environment Details

Windows 10,
NodeJS 10.3.0
Chrome 67.0.3396 + Chrome-launcher

Steps to reproduce the behaviour

  1. Start tests
  2. Wait tests finish
  3. Clear URL ( localhost:9876 )
    4 Karma crashes

Callstack

18 06 2018 09:34:11.079:ERROR [karma]: TypeError: Cannot read property 'markCaptured' of undefined
    at Launcher.markCaptured (C:\GIT\SeveraUI\node_modules\karma\lib\launcher.js:176:13)
    at Server.on (C:\GIT\SeveraUI\node_modules\karma\lib\server.js:179:16)
    at Server.emit (events.js:182:13)
    at Browser.init (C:\GIT\SeveraUI\node_modules\karma\lib\browser.js:54:18)
    at Socket.socket.on (C:\GIT\SeveraUI\node_modules\karma\lib\server.js:235:22)
    at Socket.emit (events.js:182:13)
    at C:\GIT\SeveraUI\node_modules\socket.io\lib\socket.js:513:12
    at process._tickCallback (internal/process/next_tick.js:61:11)
(node:14320) [DEP0079] DeprecationWarning: Custom inspection function on Objects via .inspect() is deprecated

Edit: This works in Karma 2.0.2

Most helpful comment

Also seeing this issue

All 7 comments

Just noticed that this PR might be related, but its not released:

https://github.com/karma-runner/karma/pull/3047

Also seeing this issue

Update your package.json and it will work

"karma": "~2.0.3",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "^1.4.3",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",

Updating the package.json in this way should not fix this issue. Install 2.0.2 if this blocks you.

I also see this behavior happen when simply opening a new browser and going to http://localhost:9876:

  • run tests and let karma start chrome with the chrome launcher: everything is fine
  • enter http://localhost:9876 in another browser navbar (firefox for example) to check if the tests pass in Firefox -> karma crashes

Hi, I am having this issue too. Is there any npm command to revert install or install older version of karma or is the best solution to revert the commit?

Fixed by #3047

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wellyshen picture wellyshen  路  4Comments

HerrDerb picture HerrDerb  路  5Comments

simonh1000 picture simonh1000  路  3Comments

schippie picture schippie  路  5Comments

anius picture anius  路  3Comments