-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
console.log throws an error for non DOM object that has 'tagName' property #2139
Closed
majuric opened this issue
May 17, 2016
· 2 comments
· Fixed by #2155 · May be fixed by Omrisnyk/npm-lockfiles#122 or Omrisnyk/npm-lockfiles#132
Closed
console.log throws an error for non DOM object that has 'tagName' property #2139
majuric opened this issue
May 17, 2016
· 2 comments
· Fixed by #2155 · May be fixed by Omrisnyk/npm-lockfiles#122 or Omrisnyk/npm-lockfiles#132
Labels
Comments
I have also run into this issue. |
I ran into this problem too. Would be nice if someone could make a patch release for this. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Karma overwrites native console.log and tries to stringify every attribute it gets passed into it so it can create an output. In the process if it encounters a DOM node or a DOM Element it attempts to serialize it https://github.com/karma-runner/karma/blob/master/client/stringify.js#L41
The problem is that detection of whether something is a DOM Node is very optimistic. I'm faced with a problem when trying to console.log a Backbone.View ( or any view that inherits form a Backbone.View ) because every Backbone.View has 'tagName' attribute, and this causes the following error in Karma because it expects a DOM node, but gets a Backbone.View in stead.
PhantomJS 2.1.1 (Linux 0.0.0) ERROR TypeError: undefined is not a function (evaluating 'target.dispatchEvent(e)') at http:https://localhost:9877/karma.js:1363
Possible solution is to change the way of checking if something is a DOM Node / Element http:https://stackoverflow.com/a/4754156/3193466
Expected behavior
var V = new Backbone.View(); console.log( V )
// Will output the View object in the console
Actual behavior
var V = new Backbone.View(); console.log( V )
`PhantomJS 2.1.1 (Linux 0.0.0) ERROR
TypeError: undefined is not a function (evaluating 'target.dispatchEvent(e)')
at http:https://localhost:9877/karma.js:1363``
Enviroment Details
karma --version
): Karma version: 0.13.22karma.config.js
file: Nothing specificSteps to reproduce the behaviour
The text was updated successfully, but these errors were encountered: