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.

Fatal error: Cannot read property %browser.id% of null

See original GitHub issue

Error happens if browser failed on start. Simplest case is when test case contained a Syntax Error. Here is the example, run grunt to se the issue.

It is rather Karma problem, because onBrowserComplete is triggered twice and suites is null’ed by the second call. Here is some debugging output:

--> onRunStart
INFO [karma]: Karma v0.12.12 server started at http://localhost:9876/
INFO [launcher]: Starting browser Chrome
INFO [Chrome 34.0.1847 (Mac OS X 10.9.2)]: Connected on socket zY0n_4LMncgG3V6ETzU9 with id 87250253
Chrome 34.0.1847 (Mac OS X 10.9.2) ERROR
  Uncaught SyntaxError: Unexpected end of input
  at /Users/siavorskyi/projects/CD/karma-junit-reporter-failure/test/syntax-error.spec.js:4

Chrome 34.0.1847 (Mac OS X 10.9.2): Executed 0 of 0 SUCCESS (0 secs / 0 secs)
--> onBrowserStart 87250253
--> initliazeXmlForBrowser
Chrome 34.0.1847 (Mac OS X 10.9.2): Executed 0 of 0 ERROR (0.002 secs / 0 secs)
--> onBrowserComplete 87250253 // suites is Object
--> onRunComplete
Chrome 34.0.1847 (Mac OS X 10.9.2): Executed 0 of 0 ERROR (0.004 secs / 0 secs)
--> onBrowserComplete 87250253 // suites is null
--> onRunComplete

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
rhenckecommented, Mar 24, 2016

@muhammad-ammar We ‘fixed’ this locally in our case but it took code changes to karma-junit-reporter. (I say ‘fixed’ because we did not address the underlying bug - we just made it work despite that).

I don’t have the code changes handy but our workaround looked very much like the one in @alexeibs’s fork here: https://github.com/Megaputer/karma-junit-reporter/commit/d14b9bffe0d3d658b8a99e2854b3e8070e50c11f and here: https://github.com/Megaputer/karma-junit-reporter/commit/9138c062c343262bccaa71571aca30d6e11d579b). You may want to try that for now.

0reactions
wesleychocommented, Dec 14, 2016

This error should be fixed in the karma-junit-reporter 1.2.0 release.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncaught TypeError: Cannot read property of null - iDiallo
It says it cannot set property disabled of null. Where is disabled used? They are the elements with id btConsulta, btDescargar and btHist....
Read more >
Uncaught TypeError: Cannot read property 'value' of null
I'm getting error in this code, I'm trying to do an event where in when the page is load, it will do the...
Read more >
Intermittent test suite failures, TypeError: Cannot read property ...
When a test fails because of a "TypeError: Object #<Sockit> has no method ... Cannot read property 'deleteSession' of null" failure pattern, ...
Read more >
cannot read property of null angular unit testing - You.com
When writing unit tests for Angular components, you may encounter the "Cannot read property 'xxx' of null" TypeError. This is usually caused by...
Read more >
[SOLVED] Cannot Read Property 'addEventListener' of Null in ...
To fix the “cannot read property 'addEventListener' of null” error, make sure the selector used the access the element is properly defined.
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