karma-jasmine icon indicating copy to clipboard operation
karma-jasmine copied to clipboard

Opening DEBUG window fires an error for parentWindow.karma object "Cannot read property 'error' of undefined"

Open ayyash opened this issue 8 years ago • 5 comments

Everytime I click on "DEBUG" mode to open a new window with the Jasmine results, no matter what the real error is I end up with TypeError: Cannot read property 'error' of undefined

That fires on the following line in context.js

if (!parentWindow.karma[method]) {
    parentWindow.karma.error('Expected Karma method "' + method + '" to exist but it doesn\'t')
    return
  }

ayyash avatar Dec 12 '16 10:12 ayyash

It's the 'karma' property that's undefined. Looking at the original window, it has it, so for whatever reason either parentWindow isn't that window or the karma property isn't visible to the new window.

DaveEmmerson avatar Jun 13 '17 06:06 DaveEmmerson

window.parent === window in this case.

"If a window does not have a parent, its parent property is a reference to itself."

DaveEmmerson avatar Jun 13 '17 06:06 DaveEmmerson

@ayyash could you provide gist which reproduces the problem

Thanks

maksimr avatar Aug 22 '17 22:08 maksimr

Sorry that was a long time ago, I haven't done work on karma since then

ayyash avatar Aug 23 '17 15:08 ayyash

Riding a dead horse but perhaps this is helping someone: I had this error with an pending('waiting for adjustment') inside an describe. Moving inside it solved the problem here.

HolgerJeromin avatar Sep 12 '23 12:09 HolgerJeromin