Do you want to request a feature or report a bug?
bug
(If this is a usage question, please do not post it here—post it on forum.sentry.io instead. If this is not a “feature” or a “bug”, or the phrase “How do I...?” applies, then it's probably a usage question.)
What is the current behavior?
raven-js throws a DataCloneError on Firefox iOS`
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar.
What is the expected behavior?
raven-js should not throw errors :-)
Which versions of Raven.js, and which browser and OS are affected by this issue? Did this work in previous versions of Raven.js? Are you using the CDN (http://ravenjs.com)? Are you using hosted Sentry or on-premises? If on-premises, which version (e.g. 8.7.0)?
DataCloneError
The object can not be cloned.
md5-8d98cbb3851da91ed7a8b8498ff688af
./node_modules/raven-js/src/raven.js in this at line 360:0
Seeing this with:
Self-hosted sentry version 3.22.1
Firefox iOS 10.6
iOS 11.2.5
Hey @jharris4, this is an error that can happen while working with WebWorkers or PostMessage calls, that are using structured cloning algorithm - https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm
Raven is using neither of them. Also when you take a look at line 360 that you provided, you can read:
// Attempt to invoke user-land function
// NOTE: If you are a Sentry user, and you are seeing this stack frame, it
// means Raven caught an error invoking your application code. This is
// expected behavior and NOT indicative of a bug with Raven.js.
Therefore, there's a very large chance that actually your code is trying to invoke the method that's causing this behavior :)
Can you past whole stack trace of the error with the snippets of code that's called?
Cheers!
Hi @kamilogorek, I did notice the comment saying it was not indicative of a bug in Raven.js! ;-)
I decided to file a bug anyway, because the error was logged to Sentry by Raven.js and I figured this should be addressed somehow...
There isn't much else to the stack trace:
DataCloneError: The object can not be cloned.
at postMessage([native code])
at this(./node_modules/raven-js/src/raven.js:360:0)
Seems like something weird that is only happening with Firefox for iOS.
I've never personally used that browser, but one of our users apparently did...
I was trying to search the web to find out what this error even means, and the only reference I can find is this one: https://stackoverflow.com/questions/42170826/categories-for-rejection-by-the-structured-cloning-algorithm
I'll try to take a look at it sometime in the future. It'd be great if someone could be able to come up with a reproducible scenario.
I’ve just started to get the same message on Raven from a windows 10 machine running Chrome 68. The full stack trace is:
DataCloneError: Failed to execute 'postMessage' on 'Window': function (a){if(qe.$a.hasOwnProperty(a))return qe.$a[a]} could not be cloned.
at _reportEvent (/:1:35800)
at eval (/:1:35800)
at eval (/:1:35800)
I’m not using WebWorkers at all in my code and don’t recognize the code as my own at all.
I did recently add code that had WeakMaps in it to my stack, and thinking from my experience in other languages I can imagine that WeakRefereces might cause errors in cloning, especially since WeakMaps and WeakSets don’t allow iterating.
@mscuthbert I'm getting the same problem for a few days now. Did you have any luck debugging?
@mscuthbert Same here, I've got one yesterday (Chrome Version: 40.0.2214, Windows 7).
Full stacktrace below:
DataCloneError: Failed to execute 'postMessage' on 'Window': function (){var r,o,a=arguments[0],s=arguments[1],u="["+(e?e+":":"")+a+"] ",l=G(arguments,2).map(function(e){re...<omitted>...)} could not be cloned.
at _reportEvent(/:1:35652)
at eval(/:1:35652)
at eval(/:1:35652)
@gmattar unfortunately we only run Raven on our obfuscated, non-map code, so debugging will bee pretty hard, but it looks like we'd all need to get this working on non-minified raven to figure out what's up.
Have the same issue now ad @Sija has
Unfortunately, any of provided stack traces are of any use, as they are all obfuscated as mentioned above. They all differ with the input though, so they are not the same:
The object can not be cloned.
Failed to execute 'postMessage' on 'Window': function (a){if(qe.$a.hasOwnProperty(a))return qe.$a[a]} could not be cloned.
Failed to execute 'postMessage' on 'Window': function (){var r,o,a=arguments[0],s=arguments[1],u="["+(e?e+":":"")+a+"] ",l=G(arguments,2).map(function(e){re...<omitted>...)} could not be cloned.
I'm not sure if there's anything we can do about it, as it's the user-code exception and we shouldn't patch nor hide it - it's meant to be reported and fixed in the codebase.
@kamilogorek -- are you sure that it's a user-code exception? It looks to me that a user-code exception is causing Raven to want to report the user problem but then what is being reported is actually an error in _reportEvent, trying to clone the user function (which will always be different) as part of the Raven script. But I think that Raven should have a fallback if it tries to clone a function that can't be cloned.
Thanks for the response and amazing software!
@mscuthbert This was also my feeling... That while this error is not likely raven's fault, it should still handle it more gracefully than it does currently.
That said, I have not seen that error at all since I first opened this issue.
We might want to change the issue title though if people truly are seeing it on browsers OTHER than Firefox for iOS ;-)
Thanks @mscuthbert! To be honest, I'm not even sure where to start, as I can't tell where this error originates from.
We already have a release candidate for our new v4 SDK, which fixes and unifies a lot of things. I'd love to get this error reported using this new version, as it should be easier to track things in there.
I'll leave this issue open until someone comes back with same issue on new SDK :)
I have not seen this error since then (we try to make it so it's really hard for users who are not hacking to create errors that go up to Raven/Sentry), so I'm not sure if I'll be able to reproduce it on SDK v.4 but will be glad to try to get it up and tested.
The problem with making new releases of software that people use for error capturing and testing -- it's probably the one part of the system that we're all most risk-adverse to using beta software on. :-)
Thanks!
We are trying our best to make sure that other developers can rely on our code. Hopefully no major issues when we release v4 :)
@mscuthbert @kamilogorek when do you plan to release v4?
@n-sviridenko its already out, check the main repo page :)
The problem is still persistent with v4.0.5
, however now it's possible to see the debug backtrace of the initial error which is nice.
https://sentry.io/share/issue/44d31cc02817475882cd519056b36558/
It's not related to sentry, but to this issue. All the people having this error were coming from facebook and having mobile devices. I assume they come from the in-app browser ("Facebook Mobile Browser") which may have this issue of having communicating between multiple opened windows. Is there anyone having a similar issue?
I've seen the error reported by desktop browsers - Chrome, Edge and Opera on Windows XP through 10. Two of the reports included a referrer: facebook.com. Interestingly, all of the reports list Facebook-owned IP addresses.
Closing this due to inactivity and not enough that we can do about this really. Due to new GitHub auto-suggest feature, this issue will still popup when anyone tries to report DataCloneError
.