-
Notifications
You must be signed in to change notification settings - Fork 30
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
Uncaught DataCloneError: Failed to execute 'postMessage' on 'Window': An object could not be cloned. #12
Comments
The browser based workflow just hangs if a test throws an Error. The following test properly reports a failure if run without the var test = require('prova')
var foo = {}
test('one', function (t) {
foo.bar();
t.ok(2+2, 4)
t.end()
}) Run with |
Line 69 of browser-reporter.js, |
OK, I've reached my limit of understanding now. :) Based on some searching and StackOverflow answers, the DataCloneError is from trying to pass an object with methods to postMessage. Indeed, changing the line to Unfortunately, uncaught errors still cause tests to fail, which makes testing promises impossible. Hopefully there is any easy fix, because I have to switch back to tape in the meantime. |
I'll look at this tonight |
Cool. The thrown error actually seems to fail the test in tape now too, but I wasn't having this issue a week or so ago when using prova so I'm not sure what is going on. I will be around later so let me know if you need or want help debugging. |
We can fix the Tape version to something like 2.5 or earlier |
This actually seems to be an issue with Angular's mock $httpBackend. Probably safe to ignore for now. |
This wasn't prova's fault. Sorry 'bout that. |
I'm running into the same problem, but with a different cause. I've isolated the problem to: var test = require('prova')
, fn = function(){}
test('sample', function(t){
t.equal(
fn
, 'object'
)
t.end()
}) I know this test doesn't do anything, but it does cause Prova to hang, when it should error. |
Does modifying browser-reporter.js correct the behavior for you as well? #12 (comment) |
@bclinkinbeard silly me for just skimming! Yes, the prevents the hang, but returns a completely unhelpful error:
…which I wasn't able to quickly track down to a prova file. |
Cool, yea, I just wanted to verify that that fixes the hang for you as well. Not sure if it is something that should be done "just in case" or if fixing the underlying issue would make it moot. I remember seeing some of that |
I'm weirded out by the fact that stringifying and then parsing the JSON would be a fix. That seems … not correct. Maybe there's a race condition somewhere? |
Yea, it's just a hack to strip methods off of the passed object since that is what triggers the DataCloneError because postMessage won't relay objects with methods. Would definitely be better if fixing the root cause (whatever it is) meant not needing to worry about the passed objects. |
Ah! That makes sense. Thanks! |
I had same error today and just shipped the |
Cool, thanks! |
I've not been able to isolate this to a reproducible scenario, but it seems to happen when async tests fail to end(). I also seem to encounter some false plan != count errors, not sure if that is related.
I will continue trying to isolate, but I figured I would report in case you have ideas on what could be the issue. Screen grab of console: http://cl.ly/image/2a392W0I3c3M
The text was updated successfully, but these errors were encountered: